MisterRaindrop commented on code in PR #97:
URL: https://github.com/apache/cloudberry-pxf/pull/97#discussion_r3056002607
##########
server/Makefile:
##########
@@ -95,6 +98,20 @@ stage-notest: prepare-gradle-wrapper
install -m 700 -d "build/stage/run"
install -m 700 -d "build/stage/keytabs"
+.PHONY: stage-jdbc-drivers
+stage-jdbc-drivers: prepare-gradle-wrapper
+ rm -rf build/stage/lib
+ ./gradlew $(PXF_GRADLE_PROPERTIES) stageJdbcDrivers
+
+.PHONY: install
Review Comment:
.PHONY: install-jdbc-drivers ?
##########
server/build.gradle:
##########
@@ -374,3 +375,11 @@ task stage(type: Copy) {
doLast { new File("${buildDir}/stage/version").text = "${version}\n" }
}
+
+task stageJdbcDrivers(type: Copy) {
+ description "Copy JDBC driver JARs from pxf-jdbc-drivers to
build/stage/lib."
+ dependsOn ":pxf-jdbc-drivers:jar"
+ from(project(':pxf-jdbc-drivers').configurations.runtimeClasspath)
+ into("${buildDir}/stage/lib")
+ duplicatesStrategy = DuplicatesStrategy.INCLUDE
Review Comment:
INCLUDE duplicate files are all retained, with later ones silently
overwriting earlier ones, so it's unclear which version ends up being the final
one.
##########
server/pxf-jdbc/src/main/java/org/apache/cloudberry/pxf/plugins/jdbc/JdbcResolver.java:
##########
@@ -506,4 +507,19 @@ private <T extends TemporalAccessor> T
parseTemporalAccessor(String rawVal, Date
}
return value;
}
+
+ /**
+ * Converts a BYTEA field value to byte[]. The value can arrive
+ * as byte[] (OutputFormat.GPDBWritable from external-table)
+ * as ByteBuffer (OutputFormat.TEXT from FDW)
+ */
+ private static byte[] toByteArray(Object val) {
+ if (val instanceof byte[]) {
+ return (byte[]) val;
+ }
+ ByteBuffer bb = (ByteBuffer) val;
Review Comment:
ByteBuffer bb = (ByteBuffer) val;
If the types do not match, a ClassCastException will be thrown directly is
better?
##########
server/build.gradle:
##########
@@ -212,8 +212,9 @@ configure(javaProjects) {
entry("avro")
entry("avro-mapred")
}
- // Zstd support for Avro/Parquet
+ // Compression support for Avro/Parquet
dependency("com.github.luben:zstd-jni:1.5.7-6")
+ dependency("at.yawk.lz4:lz4-java:1.10.3")
Review Comment:
why not org.lz4:lz4-java ?
##########
server/pxf-jdbc-drivers/build.gradle:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+dependencies {
+ // PostgreSQL driver is used by PXF itself.
Review Comment:
PostgreSQL driver? this is clickhouse driver?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]