Support single-valued BigDecimal in schema, type conversion, SQL statements and minimum set of transforms.#8503
Conversation
…l as SQL statements and few transforms (JsonExtractScalar, LiteralTransform, ScalarTransform)
Codecov Report
@@ Coverage Diff @@
## master #8503 +/- ##
============================================
- Coverage 63.60% 60.27% -3.34%
+ Complexity 4322 4284 -38
============================================
Files 1648 1684 +36
Lines 86917 88943 +2026
Branches 13265 13487 +222
============================================
- Hits 55281 53606 -1675
- Misses 27595 31355 +3760
+ Partials 4041 3982 -59
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Let's not introduce BigDecimal to the data access layer yet. We need to revisit whether we want to do implicit type casting. For now, we can enhance the CastTransformFunction to explicitly cast numbers/strings to BigDecimal bytes
pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/utils/DriverUtils.java
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/common/BlockValSet.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/common/DataBlockCache.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/operator/blocks/IntermediateResultsBlock.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java
Show resolved
Hide resolved
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Sorry for getting back and forth, but because of the different ordering behavior with BYTES type, we might have to introduce BigDecimal to the data representation layer (the underlying storage format can be the same as BYTES). For an example, if we reuse BytesDictionary for BigDecimal data type, multiple APIs (insertionIndexOf, getMinVal, getMaxVal etc.) will fail. We should add more tests into the BigDecimalQueriesTest to catch these unhandled cases.
Alternatively, if we can find a different way to serialize big decimals so that the ordering is the same as bytes ordering, then we can reuse the bytes type in the representation layer. We might want more discussion here.
...e/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/common/evaluators/DefaultJsonPathEvaluator.java
Outdated
Show resolved
Hide resolved
...va/org/apache/pinot/core/operator/transform/function/JsonExtractScalarTransformFunction.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/pinot/core/operator/transform/function/LiteralTransformFunction.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorService.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/data/FieldSpec.java
Outdated
Show resolved
Hide resolved
.../pinot/segment/local/segment/creator/impl/stats/BigDecimalColumnPredIndexStatsCollector.java
Outdated
Show resolved
Hide resolved
.../pinot/segment/local/segment/creator/impl/stats/BigDecimalColumnPredIndexStatsCollector.java
Show resolved
Hide resolved
.../pinot/segment/local/segment/creator/impl/stats/BigDecimalColumnPredIndexStatsCollector.java
Outdated
Show resolved
Hide resolved
|
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Besides Dictionary, we also want to add big-decimal support to the ForwardIndexReader, and make it a supported stored type. When we access the values, it should directly return BigDecimal objects instead of byte[] or String
pinot-core/src/main/java/org/apache/pinot/core/common/BlockValSet.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/common/DataBlockCache.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/common/utils/DataSchema.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/common/RowBasedBlockValueFetcher.java
Outdated
Show resolved
Hide resolved
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Mostly good, very impressive!
pinot-core/src/main/java/org/apache/pinot/core/common/RowBasedBlockValueFetcher.java
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/operator/blocks/IntermediateResultsBlock.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/common/evaluators/DefaultJsonPathEvaluator.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/utils/ArrayCopyUtils.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/utils/ArrayCopyUtils.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/utils/JsonUtils.java
Outdated
Show resolved
Hide resolved
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/JsonToPinotSchema.java
Outdated
Show resolved
Hide resolved
Jackie-Jiang
left a comment
There was a problem hiding this comment.
LGTM with some minor comments
There is an extra binary file that seems unrelated: pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-hadoop/pinot-plugins.tar.gz. Can you please check if it is included accidentally?
BIG_DECIMAL.BigDecimalDictionary.ForwardIndexReader.BIG_DECIMALin SQL statements:BIG_DECIMALin the following set of transforms to unblock BigDecimal ingestion and testing:transformToBytesValuesSVmethod in BaseTransformFunction.