You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/20 09:40:55 UTC

[GitHub] [pulsar] RobertIndie commented on a diff in pull request #15153: Pulsar SQL support for Decimal data type

RobertIndie commented on code in PR #15153:
URL: https://github.com/apache/pulsar/pull/15153#discussion_r853937390


##########
pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/decoder/avro/TestAvroDecoder.java:
##########
@@ -127,6 +130,9 @@ public void testPrimitiveType() {
                 "enumField", VARCHAR, false, false, "enumField", null, null, PulsarColumnHandle.HandleKeyValueType.NONE);
         checkValue(decodedRow, enumFieldColumnHandle, message.enumField.toString());
 
+        PulsarColumnHandle decimalFieldColumnHandle = new PulsarColumnHandle(getPulsarConnectorId().toString(),
+                "decimalField", DecimalType.createDecimalType(4, 2), false, false, "decimalField", null, null, PulsarColumnHandle.HandleKeyValueType.NONE);
+        checkValue(decodedRow, decimalFieldColumnHandle, message.decimalField);

Review Comment:
   Since there are two implementation of DecimalType: `ShortDecimalType` and `LongDecimalType`. And they are mapping two different type: `Long` and `Slice`.  But it looks like only the Long type was tested here. It's better to add a test case for the Slice.



-- 
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: commits-unsubscribe@pulsar.apache.org

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