You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/11/08 13:22:30 UTC

[GitHub] [nifi] exceptionfactory commented on a change in pull request #5358: NIFI-9185 Add Avro logical type to SelectHive3QL processor

exceptionfactory commented on a change in pull request #5358:
URL: https://github.com/apache/nifi/pull/5358#discussion_r744716834



##########
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:
       Is there a particular reason for using the `Schema.Type.BYTES` reference here as opposed to the union with `stringType`?

##########
File path: nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml
##########
@@ -74,6 +74,10 @@
             <groupId>org.apache.nifi</groupId>
             <artifactId>nifi-kerberos-user-service-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-kerberos-user-service-api</artifactId>

Review comment:
       Is there a reason for introducing this dependency declaration? It appears to to duplicate the dependency directly above.




-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org