Skip to content

Commit

Permalink
Support Int > 64 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
aiguofer committed Jan 6, 2024
1 parent 2b7624d commit 162a45f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public static Schema jdbcToArrowSchema(final ParameterMetaData parameterMetaData
* @return a new {@link ArrowType}.
*/
public static ArrowType getArrowTypeFromJdbcType(final JdbcFieldInfo fieldInfo, final Calendar calendar) {
int precision;
switch (fieldInfo.getJdbcType()) {
case Types.BOOLEAN:
case Types.BIT:
Expand All @@ -166,10 +167,15 @@ public static ArrowType getArrowTypeFromJdbcType(final JdbcFieldInfo fieldInfo,
case Types.INTEGER:
return new ArrowType.Int(32, true);
case Types.BIGINT:
return new ArrowType.Int(64, true);
precision = fieldInfo.getPrecision();
if (precision > 18) {
return new ArrowType.Decimal(precision, 0);
} else {
return new ArrowType.Int(64, true);
}
case Types.NUMERIC:
case Types.DECIMAL:
int precision = fieldInfo.getPrecision();
precision = fieldInfo.getPrecision();
int scale = fieldInfo.getScale();
if (precision > 38) {
return new ArrowType.Decimal(precision, scale, 256);
Expand Down

0 comments on commit 162a45f

Please sign in to comment.