Skip to content

Commit

Permalink
EXPB-3014 Fix NUMERIC
Browse files Browse the repository at this point in the history
  • Loading branch information
kramerul committed Oct 30, 2024
1 parent 1da1f93 commit efeb2cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
21 changes: 10 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,19 @@ 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:
case TIME:
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
Expand Down

0 comments on commit efeb2cd

Please sign in to comment.