exceptionfactory commented on a change in pull request #5358:
URL: https://github.com/apache/nifi/pull/5358#discussion_r744824629
##########
File path:
nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/util/hive/HiveJdbcCommon.java
##########
@@ -298,14 +318,32 @@ public static Schema createSchema(final ResultSet rs,
String recordName, boolean
// Did not find direct suitable type, need to be clarified!!!!
case DECIMAL:
case NUMERIC:
-
builder.name(columnName).type().unionOf().nullBuilder().endNull().and().stringType().endUnion().noDefault();
+ if (useLogicalTypes) {
+ final int precision =
getPrecision(meta.getPrecision(i));
+ final int scale = getScale(meta.getScale(i));
+
builder.name(columnName).type().unionOf().nullBuilder().endNull().and()
+ .type(LogicalTypes.decimal(precision,
scale).addToSchema(Schema.create(Schema.Type.BYTES))).endUnion().noDefault();
Review comment:
Thanks for the explanation @timeabarna, that makes sense.
--
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]