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

[GitHub] [pinot] walterddr commented on a diff in pull request #9385: Do not allow implicit cast between number, string, binary

walterddr commented on code in PR #9385:
URL: https://github.com/apache/pinot/pull/9385#discussion_r969889195


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DataTypeConversionFunctions.java:
##########
@@ -43,6 +43,7 @@ private DataTypeConversionFunctions() {
   public static Object cast(Object value, String targetTypeLiteral) {
     try {
       Class<?> clazz = value.getClass();
+      // TODO: Support cast for MV

Review Comment:
   did you meant element-wise? how would the semantic work?



##########
pinot-core/src/test/java/org/apache/pinot/queries/MultiValueRawQueriesTest.java:
##########
@@ -49,11 +49,7 @@
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertThrows;
-import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.*;

Review Comment:
   import Assert instead of star import?



##########
pinot-core/src/test/java/org/apache/pinot/core/common/DataFetcherTest.java:
##########
@@ -221,45 +204,23 @@ public void testFetchBigDecimalValues() {
     testFetchBigDecimalValues(FLOAT_COLUMN);
     testFetchBigDecimalValues(DOUBLE_COLUMN);
     testFetchBigDecimalValues(BIG_DECIMAL_COLUMN);
-    testFetchBigDecimalValues(STRING_COLUMN);
     testFetchBigDecimalValues(NO_DICT_INT_COLUMN);
     testFetchBigDecimalValues(NO_DICT_LONG_COLUMN);
     testFetchBigDecimalValues(NO_DICT_FLOAT_COLUMN);
     testFetchBigDecimalValues(NO_DICT_DOUBLE_COLUMN);
     testFetchBigDecimalValues(NO_DICT_BIG_DECIMAL_COLUMN);
-    testFetchBigDecimalValues(NO_DICT_STRING_COLUMN);
   }
 
   @Test
   public void testFetchStringValues() {
-    testFetchStringValues(INT_COLUMN);
-    testFetchStringValues(LONG_COLUMN);
-    testFetchStringValues(FLOAT_COLUMN);
-    testFetchStringValues(DOUBLE_COLUMN);
-    testFetchStringValues(BIG_DECIMAL_COLUMN);
     testFetchStringValues(STRING_COLUMN);
-    testFetchStringValues(NO_DICT_INT_COLUMN);
-    testFetchStringValues(NO_DICT_LONG_COLUMN);
-    testFetchStringValues(NO_DICT_FLOAT_COLUMN);
-    testFetchStringValues(NO_DICT_DOUBLE_COLUMN);
-    testFetchStringValues(NO_DICT_BIG_DECIMAL_COLUMN);

Review Comment:
   I understand implicit type cast from STRING to NUMBER is not a good practice. but do we want to support the otherway around?



-- 
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@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org