Posted by
GitBox on
Jan 22, 2021; 6:02am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-akkio-97-opened-a-new-pull-request-4073-WIP-tp105327p105546.html
akkio-97 commented on a change in pull request #4073:
URL:
https://github.com/apache/carbondata/pull/4073#discussion_r561605603##########
File path: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java
##########
@@ -328,9 +328,29 @@ public BigDecimal getDecimal(Object valueToBeConverted) {
public void fillVector(Object valuesToBeConverted, int size,
ColumnVectorInfo vectorInfo, BitSet nullBitSet, DataType pageType) {
CarbonColumnVector vector = getCarbonColumnVector(vectorInfo, nullBitSet);
- //TODO handle complex child
- int precision = vectorInfo.measure.getMeasure().getPrecision();
- int newMeasureScale = vectorInfo.measure.getMeasure().getScale();
+ int precision;
Review comment:
done
##########
File path: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java
##########
@@ -348,6 +368,32 @@ public void fillVector(Object valuesToBeConverted, int size,
vector.putDecimal(i, value, precision);
}
}
+ } else if (valuesToBeConverted instanceof byte[]) {
Review comment:
done
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/SparkStoreCreatorForPresto.scala
##########
@@ -365,6 +365,15 @@ class SparkStoreCreatorForPresto extends QueryTest with BeforeAndAfterAll{
sql(s"""LOAD DATA LOCAL INPATH '$resourcesPath/IUD/dest.csv' INTO TABLE streaming_table""")
}
+ test("Test decimal unscaled converter") {
+ sql("drop table if exists array_decimal")
+ sql(
+ "CREATE TABLE IF NOT EXISTS array_decimal (salary array<decimal(20,3)>) STORED AS " +
+ "carbondata"
+ )
+ sql("insert into array_decimal select array(922.580, 3.435) ")
Review comment:
done
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -325,4 +326,22 @@ class PrestoTestUsingSparkStore
}
+ test("Test decimal unscaled converter") {
+ prestoServer
+ .execute(
+ "create table presto_spark_db.array_decimal(salary array(decimal(20,3)) ) with" +
+ "(format='CARBON') ")
+ copyStoreContents("array_decimal")
+ val result: List[Map[String, Any]] = prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.array_decimal")
+ assert(result.size == 1)
+ for (i <- 0 to 0) {
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[hidden email]