Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions be/cmake/thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,24 @@ add_thirdparty(icudata LIB64)


add_thirdparty(pugixml LIB64)

# Prepare explicit targets without enabling a reader or requiring new prebuilt libraries yet.
# For example, existing BE targets keep working until a MongoDB reader links mongoc2/bson2.
add_thirdparty(bson2 LIB64 NOTADD)
set_target_properties(bson2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/include/bson-2.0"
INTERFACE_COMPILE_DEFINITIONS BSON_STATIC)
add_thirdparty(mongoc2 LIB64 NOTADD)
set_target_properties(mongoc2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/include/mongoc-2.0"
INTERFACE_COMPILE_DEFINITIONS MONGOC_STATIC)
# Threads and the platform DNS resolver are OS/toolchain components, not vendored libraries.
find_package(Threads REQUIRED)
target_link_libraries(mongoc2 INTERFACE
bson2 snappy zstd libz cyrus-sasl gssapi_krb5 krb5 k5crypto com_err krb5support
openssl crypto Threads::Threads ${CMAKE_DL_LIBS})
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(mongoc2 INTERFACE m resolv)
elseif(OS_MACOSX)
target_link_libraries(mongoc2 INTERFACE resolv)
endif()
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ if [[ "${BUILD_FE}" -eq 1 ]]; then
fi
done
unset _conn_mod
# Build the dependency bundle before the native connector provider is implemented.
modules+=("fe-connector/fe-connector-mongodb")
# Authorization plugin modules (loaded at runtime from plugins/authorization/). Keep this list
# identical to the deploy loop's (search AUTHZ_PLUGIN_DIR), for the same reason as the connectors:
# the deploy step unzips whatever archive is left in the module's target/, so a module built here
Expand Down Expand Up @@ -1348,6 +1350,10 @@ if [[ "${BUILD_FE}" -eq 1 ]]; then
# Deploy connector provider plugins as independent plugin directories.
# Each sub-directory is one connector backend loaded at runtime by ConnectorPluginManager.
CONN_PLUGIN_DIR="${DORIS_OUTPUT}/fe/plugins/connector"
# Keep this dependency-only archive out of auto-discovery, which requires a provider class.
mkdir -p "${CONN_PLUGIN_DIR}"
Comment thread
Gabriel39 marked this conversation as resolved.
Resolved
cp -p "${DORIS_HOME}/fe/fe-connector/fe-connector-mongodb/target/doris-fe-connector-mongodb.zip" \
"${CONN_PLUGIN_DIR}/mongodb.zip"
for conn_module in es jdbc maxcompute trino hms hive paimon hudi iceberg adbc fluss; do
conn_plugin_target="${CONN_PLUGIN_DIR}/${conn_module}"
conn_module_dir="${DORIS_HOME}/fe/fe-connector/fe-connector-${conn_module}"
Expand Down
5 changes: 5 additions & 0 deletions dist/LICENSE-dist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1515,3 +1515,8 @@ Other dependencies:
* pugixml 1.15 -- licenses/LICENSE-pugixml.txt
* darts-clone (double-array trie, compiled into the kuromoji dictionary) -- licenses/LICENSE-darts-clone.txt
* mecab-ipadic (IPADIC) 2.7.0-20250920 (Japanese dictionary data shipped under be/dict/kuromoji) -- licenses/LICENSE-ipadic.txt

* MongoDB C Driver (libmongoc/libbson): 2.5.8 -- Apache License 2.0; bundled notices in licenses/LICENSE-mongo-c-driver.txt
* MongoDB Java Sync Driver (sync/core/bson/bson-record-codec): 5.14.0 -- Apache License 2.0
* snappy-java (MongoDB bundle): 1.1.10.10 -- Apache License 2.0
* zstd-jni (MongoDB bundle): 1.5.7-25 -- licenses/LICENSE-zstd-jni.txt
184 changes: 184 additions & 0 deletions dist/licenses/LICENSE-mongo-c-driver.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
The MongoDB C Driver uses third-party code distributed under different licenses.

License notice for uthash
-------------------------------------------------------------------------------

Copyright (c) 2003-2021, Troy D. Hanson http://troydhanson.github.com/uthash/
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

License notice for common-b64.c
-------------------------------------------------------------------------------

ISC License

Copyright: 1996, 1998 Internet Software Consortium
1995 International Business Machines, Inc.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Portions Copyright (c) 1995 by International Business Machines, Inc.

International Business Machines, Inc. (hereinafter called IBM) grants
permission under its copyrights to use, copy, modify, and distribute this
Software with or without fee, provided that the above copyright notice and
all paragraphs of this notice appear in all copies, and that the name of IBM
not be used in connection with the marketing of any product incorporating
the Software or modifications thereof, without specific, written prior
permission.

To the extent it has a right to do so, IBM grants an immunity from suit
under its patents, if any, for the use, sale or manufacture of products to
the extent that such products are used for performing Domain Name System
dynamic updates in TCP/IP networks by means of the Software. No immunity is
granted for any product per se or for any other function of any product.

THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.


License notice for mongoc.css_t
-------------------------------------------------------------------------------

MIT License

Portions Copyright 2013 by Ignacy Sokolowski.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


License notice for zlib
-------------------------------------------------------------------------------
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.11, January 15th, 2017

Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu


The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
(zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
*/

License notice for common-md5.c
-------------------------------------------------------------------------------

ZLib License

Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

L. Peter Deutsch
ghost@aladdin.com

License notice for utf8proc
-------------------------------------------------------------------------------

**utf8proc** is a software package originally developed
by Jan Behrens and the rest of the Public Software Group, who
deserve nearly all of the credit for this library, that is now maintained by the Julia-language developers. Like the original utf8proc,
whose copyright and license statements are reproduced below, all new
work on the utf8proc library is licensed under the [MIT "expat"
license](http://opensource.org/licenses/MIT):

*Copyright © 2014-2021 by Steven G. Johnson, Jiahao Chen, Tony Kelman, Jonas Fonseca, and other contributors listed in the git history.*

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
28 changes: 28 additions & 0 deletions fe/fe-connector/fe-connector-mongodb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Native MongoDB client dependencies

This module prepares the Java dependencies for the native MongoDB connector. It
bundles the official synchronous driver, its core, BSON, and BSON record codec
at one version, using a module-local BOM so other connector plugins keep their
own dependencies. The archive also carries the Snappy and Zstandard Java providers
so FE metadata reads accept the same compression URI options as the native BE.
The FE host supplies logging APIs and bindings.

The dependency-only archive does not register a `ConnectorProvider` and cannot
create a MongoDB catalog. The FE build stages it as
`plugins/connector/mongodb.zip`, without unpacking it into an auto-loaded plugin
directory. A later connector implementation will add the provider and enable the
normal plugin deployment path.

The BE uses the MongoDB C Driver (`libmongoc` and `libbson`) built together by:

```sh
bash thirdparty/build-thirdparty.sh mongo_c_driver
```

The native build produces PIC static archives with OpenSSL, Cyrus SASL, SRV DNS,
Snappy, zstd and zlib support. It reuses Doris-managed dependencies and the driver's
bundled utf8proc for SCRAM-SHA-256. It does not require the C++ driver, a BE JVM,
Reactive Streams, or client-side encryption libraries. The reader and BSON
`DataTypeSerDe` implementation are separate changes. The BE CMake targets `bson2`
and `mongoc2` expose the static headers, definitions and dependency closure; they
are not added to the common BE link set until a reader consumes them.
92 changes: 92 additions & 0 deletions fe/fe-connector/fe-connector-mongodb/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.doris</groupId>
<artifactId>fe-connector</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>fe-connector-mongodb</artifactId>
<packaging>jar</packaging>
<name>Doris FE Connector - MongoDB Dependencies</name>
<description>Client dependency bundle for the native MongoDB connector.</description>
<properties>
<mongodb.driver.version>5.14.0</mongodb.driver.version>
<!-- Override the older FE-wide pin to reject oversized Snappy allocations and fix stream handling. -->
<mongodb.snappy-java.version>1.1.10.10</mongodb.snappy-java.version>
<mongodb.zstd-jni.version>1.5.7-25</mongodb.zstd-jni.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Align the sync driver, core and BSON without changing other plugins' closures. -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-bom</artifactId>
<version>${mongodb.driver.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
Comment thread
Gabriel39 marked this conversation as resolved.
Resolved
</dependency>
<!-- URI compressors apply to FE metadata reads too; keep both client paths usable. -->
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>${mongodb.snappy-java.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>${mongodb.zstd-jni.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<finalName>doris-fe-connector-mongodb</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/plugin-zip.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals><goal>single</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading
Loading