diff --git a/build.sh b/build.sh index aab9a6c5173..014099581d0 100755 --- a/build.sh +++ b/build.sh @@ -19,20 +19,19 @@ set -e VERSION=1.38.0 # Java 21 doesn't suppport Java 8 -if [ -d /Library/Java/JavaVirtualMachines/sapmachine-jdk-17.0.11.jdk/Contents/Home ]; then - export JAVA_HOME=/Library/Java/JavaVirtualMachines/sapmachine-jdk-17.0.11.jdk/Contents/Home - export PATH=$JAVA_HOME/bin:$PATH -fi +#if [ -d /Library/Java/JavaVirtualMachines/sapmachine-jdk-17.0.11.jdk/Contents/Home ]; then +# export JAVA_HOME=/Library/Java/JavaVirtualMachines/sapmachine-jdk-17.0.11.jdk/Contents/Home +# export PATH=$JAVA_HOME/bin:$PATH +#fi -if [ -d /Library/Java/JavaVirtualMachines/sapmachine-17.jdk/Contents/Home ]; then - export JAVA_HOME=/Library/Java/JavaVirtualMachines/sapmachine-17.jdk/Contents/Home - export PATH=$JAVA_HOME/bin:$PATH -fi +#if [ -d /Library/Java/JavaVirtualMachines/sapmachine-17.jdk/Contents/Home ]; then +# export JAVA_HOME=/Library/Java/JavaVirtualMachines/sapmachine-17.jdk/Contents/Home +# export PATH=$JAVA_HOME/bin:$PATH +#fi -./gradlew clean publishToMavenLocal - -for module in core linq4j; +for module in linq4j core; do + ./gradlew :${module}:clean :${module}:publishToMavenLocal mvn install:install-file \ -Dfile=${module}/build/libs/calcite-${module}-$VERSION-SNAPSHOT.jar \ -DgroupId=org.apache.calcite \ diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java index 86effd5d41f..abd89ed8a85 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java @@ -421,7 +421,7 @@ RelProtoDataType getRelDataType(DatabaseMetaData metaData, String catalogName, final String columnName = requireNonNull(resultSet.getString(4), "columnName"); final int dataType = resultSet.getInt(5); final String typeString = resultSet.getString(6); - final int precision; + int precision; final int scale; switch (SqlType.valueOf(dataType)) { case TIMESTAMP: @@ -429,6 +429,11 @@ RelProtoDataType getRelDataType(DatabaseMetaData metaData, String catalogName, precision = resultSet.getInt(9); // SCALE scale = 0; break; + case NUMERIC: + precision = resultSet.getInt(7); // SIZE + scale = resultSet.getInt(9); // SCALE + if ( precision == 0 ) precision = 19; + break; default: precision = resultSet.getInt(7); // SIZE scale = resultSet.getInt(9); // SCALE