kumarvishal09 commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479657086 ########## File path: integration/presto/src/main/prestosql/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.java ########## @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.carbondata.presto.readers; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import io.prestosql.spi.block.ArrayBlock; +import io.prestosql.spi.block.RowBlock; +import io.prestosql.spi.type.*; + +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.datatype.DataTypes; +import org.apache.carbondata.core.metadata.datatype.StructField; +import org.apache.carbondata.core.scan.result.vector.CarbonColumnVector; +import org.apache.carbondata.core.scan.result.vector.impl.CarbonColumnVectorImpl; + +import io.prestosql.spi.block.Block; +import io.prestosql.spi.block.BlockBuilder; + +import org.apache.carbondata.presto.CarbonVectorBatch; +import org.apache.carbondata.presto.ColumnarVectorWrapperDirect; + +/** + * Class to read the complex type Stream [array/struct/map] + */ + +public class ComplexTypeStreamReader extends CarbonColumnVectorImpl + implements PrestoVectorBlockBuilder { + + protected int batchSize; + + protected Type type; + protected BlockBuilder builder; + + public ComplexTypeStreamReader(int batchSize, StructField field) { + super(batchSize, field.getDataType()); + this.batchSize = batchSize; + this.type = getType(field); + ArrayList<CarbonColumnVector> childrenList = new ArrayList<>(); Review comment: Better use Interface type, List instead of ArrayList ---------------------------------------------------------------- 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] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479661505 ########## File path: integration/presto/src/main/prestosql/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.java ########## @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.carbondata.presto.readers; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import io.prestosql.spi.block.ArrayBlock; +import io.prestosql.spi.block.RowBlock; +import io.prestosql.spi.type.*; + +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.datatype.DataTypes; +import org.apache.carbondata.core.metadata.datatype.StructField; +import org.apache.carbondata.core.scan.result.vector.CarbonColumnVector; +import org.apache.carbondata.core.scan.result.vector.impl.CarbonColumnVectorImpl; + +import io.prestosql.spi.block.Block; +import io.prestosql.spi.block.BlockBuilder; + +import org.apache.carbondata.presto.CarbonVectorBatch; +import org.apache.carbondata.presto.ColumnarVectorWrapperDirect; + +/** + * Class to read the complex type Stream [array/struct/map] + */ + +public class ComplexTypeStreamReader extends CarbonColumnVectorImpl + implements PrestoVectorBlockBuilder { + + protected int batchSize; + + protected Type type; + protected BlockBuilder builder; + + public ComplexTypeStreamReader(int batchSize, StructField field) { + super(batchSize, field.getDataType()); + this.batchSize = batchSize; + this.type = getType(field); + ArrayList<CarbonColumnVector> childrenList = new ArrayList<>(); Review comment: done ########## File path: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java ########## @@ -187,6 +197,43 @@ public void fillVector(Object valuesToBeConverted, int size, vector.putDecimal(i, value, precision); } } + } else if (pageType == DataTypes.BYTE_ARRAY) { + // complex primitive decimal dimension + int offset = 0; + for (int j = 0; j < size; j++) { + // here decimal data will be Length[4 byte], scale[1 byte], value[Length byte] + int len = ByteBuffer.wrap(data, offset, DataTypes.INT.getSizeInBytes()).getInt(); + offset += DataTypes.INT.getSizeInBytes(); 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] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479661536 ########## File path: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java ########## @@ -187,6 +197,43 @@ public void fillVector(Object valuesToBeConverted, int size, vector.putDecimal(i, value, precision); } } + } else if (pageType == DataTypes.BYTE_ARRAY) { + // complex primitive decimal dimension + int offset = 0; + for (int j = 0; j < size; j++) { + // here decimal data will be Length[4 byte], scale[1 byte], value[Length byte] + int len = ByteBuffer.wrap(data, offset, DataTypes.INT.getSizeInBytes()).getInt(); + offset += DataTypes.INT.getSizeInBytes(); Review comment: handled all the 5 files including base code ---------------------------------------------------------------- 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] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479661551 ########## File path: integration/presto/src/main/prestosql/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.java ########## @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.carbondata.presto.readers; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import io.prestosql.spi.block.ArrayBlock; +import io.prestosql.spi.block.RowBlock; +import io.prestosql.spi.type.*; + +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.datatype.DataTypes; +import org.apache.carbondata.core.metadata.datatype.StructField; +import org.apache.carbondata.core.scan.result.vector.CarbonColumnVector; +import org.apache.carbondata.core.scan.result.vector.impl.CarbonColumnVectorImpl; + +import io.prestosql.spi.block.Block; +import io.prestosql.spi.block.BlockBuilder; + +import org.apache.carbondata.presto.CarbonVectorBatch; +import org.apache.carbondata.presto.ColumnarVectorWrapperDirect; + +/** + * Class to read the complex type Stream [array/struct/map] + */ + +public class ComplexTypeStreamReader extends CarbonColumnVectorImpl + implements PrestoVectorBlockBuilder { + + protected int batchSize; + + protected Type type; + protected BlockBuilder builder; + + public ComplexTypeStreamReader(int batchSize, StructField field) { + super(batchSize, field.getDataType()); + this.batchSize = batchSize; + this.type = getType(field); + ArrayList<CarbonColumnVector> childrenList = new ArrayList<>(); Review comment: check and handled all the newly added code ---------------------------------------------------------------- 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] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-683320513 Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2174/ ---------------------------------------------------------------- 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] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-683321068 Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3915/ ---------------------------------------------------------------- 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] |
In reply to this post by GitBox
kumarvishal09 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-683368433 LGTM ---------------------------------------------------------------- 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] |
In reply to this post by GitBox
asfgit closed pull request #3887: URL: https://github.com/apache/carbondata/pull/3887 ---------------------------------------------------------------- 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] |
Free forum by Nabble | Edit this page |