mirror of
https://github.com/apache/doris.git
synced 2026-11-04 07:31:17 +00:00
### What problem does this PR solve?
Issue Number: N/A
Problem Summary: Add `h3_lat_lng_to_cell`, `h3_cell_to_lat_lng`, and
`h3_cell_to_boundary` using official H3 4.5.0. Coordinates use degrees
in latitude/longitude order. Invalid inputs return NULL; centers contain
two coordinates and boundaries preserve H3 vertex order without closing
the ring. Input NULL propagation uses the default execution framework.
FE has no separate Java H3 evaluator; constant folding through BE
remains supported.
Build H3 as a static C library from its 18 upstream core sources.
Generate its versioned API header in the build directory, export include
paths through the target, enable PIC, and inherit Doris sanitizer flags.
Only the H3 target relaxes third-party warning errors. The wrapper
avoids upstream standalone tools and global build options. Include the
upstream license attribution and NOTICE.
### Release note
Add three H3 SQL functions for mapping coordinates to cells and
retrieving cell centers and boundaries.
### Check List (For Author)
- Test
- [x] Regression test
- [x] Unit Test
- [x] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- Behavior changed:
- [ ] No.
- [x] Yes. Add three SQL functions.
- Does this need documentation?
- [ ] No.
- [x] Yes. SQL function documentation is needed; no documentation PR
yet.
Validation on Linux x86_64:
- ASAN BE build and clean FE build passed; H3 objects carry ASAN/UBSAN
flags.
- `run-be-ut.sh --run --filter=FunctionH3Test.* -j48`: all three tests
passed.
- `run-regression-test.sh --run -d
query_p0/sql_functions/spatial_functions -s test_h3`: generated results
with `-forceGenOut`, inspected them, and reran successfully. Includes
constant-folding modes, nullable/non-nullable table columns, all 16
resolutions, stored nested arrays, array expansion, filtering/grouping,
and 35,000 mixed rows.
- Compared 10,000 inputs per function against official C/Python H3
4.5.0: exact agreement. ClickHouse 26.3.9.8 (H3 3.7.1) matched cell IDs
and coordinates within tolerance (maximum coordinate error 8.29e-8
degrees).
- Clang-format 16 and targeted clang-tidy checks passed; no sanitizer
diagnostics during these tests. ARM/macOS builds were not run.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
107 lines
4.7 KiB
Plaintext
107 lines
4.7 KiB
Plaintext
Apache Doris
|
|
Copyright 2018-2026 The Apache Software Foundation
|
|
|
|
This product includes software developed at
|
|
The Apache Software Foundation (http://www.apache.org/).
|
|
|
|
Based on source code originally developed by
|
|
Baidu (http://www.baidu.com/).
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
This product includes code from Apache Impala, which includes the following in
|
|
its NOTICE file:
|
|
|
|
Apache Impala
|
|
Copyright 2019 The Apache Software Foundation
|
|
|
|
This product includes software developed at
|
|
The Apache Software Foundation (http://www.apache.org/).
|
|
|
|
Portions of this software were developed at
|
|
Cloudera, Inc (http://www.cloudera.com/).
|
|
|
|
This product includes software developed by the OpenSSL
|
|
Project for use in the OpenSSL Toolkit (http://www.openssl.org/)
|
|
|
|
This product includes cryptographic software written by Eric Young
|
|
(eay@cryptsoft.com). This product includes software written by Tim
|
|
Hudson (tjh@cryptsoft.com).
|
|
|
|
This product includes software developed by the University of Chicago,
|
|
as Operator of Argonne National Laboratory.
|
|
Copyright (C) 1999 University of Chicago. All rights reserved.
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
This product includes code from Apache Kudu, which includes the following in
|
|
its NOTICE file:
|
|
|
|
Apache Kudu
|
|
Copyright 2016 The Apache Software Foundation
|
|
|
|
This product includes software developed at
|
|
The Apache Software Foundation (http://www.apache.org/).
|
|
|
|
Portions of this software were developed at
|
|
Cloudera, Inc (http://www.cloudera.com/).
|
|
|
|
This product includes software developed by the OpenSSL
|
|
Project for use in the OpenSSL Toolkit (http://www.openssl.org/)
|
|
|
|
This product includes cryptographic software written by Eric Young
|
|
(eay@cryptsoft.com). This product includes software written by Tim
|
|
Hudson (tjh@cryptsoft.com).
|
|
|
|
--------------------------------------------------------------------------------
|
|
This product includes code from AWS SDK, which includes the following in
|
|
its NOTICE file:
|
|
|
|
AWS SDK for Java 2.0
|
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
|
This product includes software developed by
|
|
Amazon Technologies, Inc (http://www.amazon.com/).
|
|
|
|
**********************
|
|
THIRD PARTY COMPONENTS
|
|
**********************
|
|
This software includes third party software subject to the following copyrights:
|
|
- XML parsing and utility functions from JetS3t - Copyright 2006-2009 James Murty.
|
|
- PKCS#1 PEM encoded private key parsing and utility functions from oauth.googlecode.com - Copyright 1998-2010 AOL Inc.
|
|
- Apache Commons Lang - https://github.com/apache/commons-lang
|
|
- Netty Reactive Streams - https://github.com/playframework/netty-reactive-streams
|
|
- Jackson-core - https://github.com/FasterXML/jackson-core
|
|
- Jackson-dataformat-cbor - https://github.com/FasterXML/jackson-dataformats-binary
|
|
- Darts-clone (double-array trie) - Copyright 2008-2014 Susumu Yata - https://github.com/s-yata/darts-clone (BSD 2-clause)
|
|
- mecab-ipadic (IPADIC) Japanese morphological dictionary - Copyright 2000-2003 Nara Institute of Science and Technology (NAIST) - licensed under NAIST-2003 (BSD-style); the kuromoji analyzer bundles the UTF-8 form from https://github.com/lindera/mecab-ipadic (content of mecab-ipadic-2.7.0-20070801).
|
|
- Apache Lucene - https://github.com/apache/lucene (Apache-2.0): the kuromoji Japanese analyzer under be/src/storage/index/inverted/analysis/analyzer/kuromoji is an independent C++ implementation modeled on Lucene's kuromoji analyzer (JapaneseTokenizer), including its search-mode compound-decomposition cost model.
|
|
|
|
The licenses for these third party components are included in LICENSE.txt
|
|
|
|
- For Apache Commons Lang see also this required NOTICE:
|
|
Apache Commons Lang
|
|
Copyright 2001-2020 The Apache Software Foundation
|
|
|
|
This product includes software developed at
|
|
The Apache Software Foundation (https://www.apache.org/).
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
This product includes H3 (https://github.com/uber/h3), which includes the
|
|
following in its NOTICE file:
|
|
|
|
Copyright 2017-2021 Uber Technologies, Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|