[incubator-pinot] 01/01: update column data type cast during inter merge

2019-08-16 Thread xiangfu
This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch update_selection_query_1
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit ecac2e0b57e3b583ee7827adc5a432562217a2c6
Author: Xiang Fu 
AuthorDate: Thu Aug 15 22:19:08 2019 -0700

update column data type cast during inter merge
---
 .../pinot/core/operator/transform/TransformBlockDataFetcher.java | 5 +
 .../apache/pinot/core/query/selection/SelectionOperatorUtils.java| 5 -
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/TransformBlockDataFetcher.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/TransformBlockDataFetcher.java
index 54e83be..b5c8d99 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/TransformBlockDataFetcher.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/TransformBlockDataFetcher.java
@@ -199,9 +199,6 @@ class DictionaryBasedSVValueFetcher implements Fetcher {
   }
 
   public Serializable getValue(int docId) {
-if (_dataType.equals(FieldSpec.DataType.BYTES)) {
-  return 
BytesUtils.toHexString(_dictionary.getBytesValue(_dictionaryIds[docId]));
-}
 return (Serializable) _dictionary.get(_dictionaryIds[docId]);
   }
 }
@@ -337,4 +334,4 @@ class DictionaryBasedMVBytesValueFetcher implements Fetcher 
{
 }
 return values;
   }
-}
\ No newline at end of file
+}
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
index bbfa42f..0fe09a5 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
@@ -39,6 +39,7 @@ import org.apache.pinot.common.request.Selection;
 import org.apache.pinot.common.request.SelectionSort;
 import org.apache.pinot.common.response.ServerInstance;
 import org.apache.pinot.common.response.broker.SelectionResults;
+import org.apache.pinot.common.utils.BytesUtils;
 import org.apache.pinot.common.utils.DataSchema;
 import org.apache.pinot.common.utils.DataTable;
 import org.apache.pinot.core.common.DataSourceMetadata;
@@ -248,9 +249,11 @@ public class SelectionOperatorUtils {
 dataTableBuilder.setColumn(i, ((Number) 
columnValue).doubleValue());
 break;
   case STRING:
-  case BYTES: // BYTES are already converted to String for Selection, 
before reaching this layer.
 dataTableBuilder.setColumn(i, ((String) columnValue));
 break;
+  case BYTES:
+dataTableBuilder.setColumn(i, BytesUtils.toHexString((byte[]) 
columnValue));
+break;
 
   // Multi-value column.
   case INT_ARRAY:


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



[incubator-pinot] 01/01: update column data type cast during inter merge

2019-08-15 Thread xiangfu
This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch update_selection_query
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 39c91cf7aa6f7bd3d305576474783779f8fc8363
Author: Xiang Fu 
AuthorDate: Thu Aug 15 22:19:08 2019 -0700

update column data type cast during inter merge
---
 .../apache/pinot/core/query/selection/SelectionOperatorUtils.java  | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
index bbfa42f..42d3e64 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
@@ -39,6 +39,7 @@ import org.apache.pinot.common.request.Selection;
 import org.apache.pinot.common.request.SelectionSort;
 import org.apache.pinot.common.response.ServerInstance;
 import org.apache.pinot.common.response.broker.SelectionResults;
+import org.apache.pinot.common.utils.BytesUtils;
 import org.apache.pinot.common.utils.DataSchema;
 import org.apache.pinot.common.utils.DataTable;
 import org.apache.pinot.core.common.DataSourceMetadata;
@@ -249,7 +250,11 @@ public class SelectionOperatorUtils {
 break;
   case STRING:
   case BYTES: // BYTES are already converted to String for Selection, 
before reaching this layer.
-dataTableBuilder.setColumn(i, ((String) columnValue));
+if (columnValue instanceof byte[]) {
+  dataTableBuilder.setColumn(i, BytesUtils.toHexString((byte[]) 
columnValue));
+} else {
+  dataTableBuilder.setColumn(i, ((String) columnValue));
+}
 break;
 
   // Multi-value column.


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