GitHub user chenerlu opened a pull request:
https://github.com/apache/carbondata/pull/1105 [WIP] Implement range interval partition This PR is try to implement range interval partition and now work on process. You can merge this pull request into a Git repository by running: $ git pull https://github.com/chenerlu/incubator-carbondata RangeInterval3 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/carbondata/pull/1105.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1105 ---- commit 016377b614a29b65e67a5a965ac2ebaedb86dfe6 Author: chenerlu <[hidden email]> Date: 2017-06-22T09:13:05Z Step 1 of implement range interval partition type commit a21c006bbe20df50d642bc80df351bb83dcab0f2 Author: chenerlu <[hidden email]> Date: 2017-06-27T13:03:44Z Implement range interval partition commit c4105290a4ac791f48525d2dd293909856600920 Author: chenerlu <[hidden email]> Date: 2017-06-28T04:10:31Z just add some test cases commit 90bbd1a58e79bf3548e1e5cff29714ea6c928df6 Author: chenerlu <[hidden email]> Date: 2017-06-28T04:17:05Z Merge branch 'master' into RangeInterval2 ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
Github user asfgit commented on the issue:
https://github.com/apache/carbondata/pull/1105 Can one of the admins verify this patch? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1105 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2758/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:
https://github.com/apache/carbondata/pull/1105 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/carbondata-pr-spark-1.6/687/<h2>Build result: FAILURE</span></h2>[...truncated 64.18 KB...][ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR] mvn <goals> -rf :carbondata-spark-common[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/processing/pom.xml to org.apache.carbondata/carbondata-processing/1.2.0-SNAPSHOT/carbondata-processing-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common/pom.xml to org.apache.carbondata/carbondata-spark-common/1.2.0-SNAPSHOT/carbondata-spark-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkin s-slave/workspace/carbondata-pr-spark-1.6/examples/spark/pom.xml to org.apache.carbondata/carbondata-examples-spark/1.2.0-SNAPSHOT/carbondata-examples-spark-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/hive/pom.xml to org.apache.carbondata/carbondata-hive/1.2.0-SNAPSHOT/carbondata-hive-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/common/pom.xml to org.apache.carbondata/carbondata-common/1.2.0-SNAPSHOT/carbondata-common-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/assembly/pom.xml to org.apache.carbondata/carbondata-assembly/1.2.0-SNAPSHOT/carbondata-assembly-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/pom.xml to org.apache.carbondata/carbondata-parent/1.2.0-SNAPSHOT/carbondata-parent-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/works pace/carbondata-pr-spark-1.6/examples/flink/pom.xml to org.apache.carbondata/carbondata-examples-flink/1.2.0-SNAPSHOT/carbondata-examples-flink-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/core/pom.xml to org.apache.carbondata/carbondata-core/1.2.0-SNAPSHOT/carbondata-core-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/hadoop/pom.xml to org.apache.carbondata/carbondata-hadoop/1.2.0-SNAPSHOT/carbondata-hadoop-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/presto/pom.xml to org.apache.carbondata/carbondata-presto/1.2.0-SNAPSHOT/carbondata-presto-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark-common-test/pom.xml to org.apache.carbondata/carbondata-spark-common-test/1.2.0-SNAPSHOT/carbondata-spark-common-test-1.2.0-SNAPSHOT.pom[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/carbondata-pr-spark-1.6/integration/spark/pom.xml to org.apache.carbondata/carbondata-spark/1.2.0-SNAPSHOT/carbondata-spark-1.2.0-SNAPSHOT.pomchannel stoppedSetting status of 90bbd1a58e79bf3548e1e5cff29714ea6c928df6 to FAILURE with url https://builds.apache.org/job/carbondata-pr-spark-1.6/687/ and message: 'Tests Failed for Spark1.6 'Using context: Jenkins(Spark1.6): mvn clean test -Pspark-1.6 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1105 Build Failed with Spark 1.6, Please check CI http://144.76.159.231:8080/job/ApacheCarbonPRBuilder/179/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1105 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2759/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1105 Build Failed with Spark 1.6, Please check CI http://144.76.159.231:8080/job/ApacheCarbonPRBuilder/180/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:
https://github.com/apache/carbondata/pull/1105 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/carbondata-pr-spark-1.6/688/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1105 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2789/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:
https://github.com/apache/carbondata/pull/1105 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/carbondata-pr-spark-1.6/724/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1105 Build Failed with Spark 1.6, Please check CI http://144.76.159.231:8080/job/ApacheCarbonPRBuilder/210/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126057425 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/partition/RangeIntervalPartition.java --- @@ -0,0 +1,50 @@ +/* + * 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.core.metadata.schema.partition; + + +public class RangeIntervalPartition extends AbstractPartition { --- End diff -- AbstractPartition has been removed. Now only store rangeInfo/ListInfo in partitionInfo. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126327814 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/partition/PartitionFilterUtil.java --- @@ -264,4 +265,81 @@ public static BitSet getPartitionMapForRangeFilter(PartitionInfo partitionInfo, return partitionMap; } + /** + * get partition map of range interval filter on range interval partition table + * @param partitionInfo + * @param partitioner + * @param filterValue + * @param isGreaterThan + * @param isEqualTo + * @return + */ + public static BitSet getPartitionMapForRangeIntervalFilter(PartitionInfo partitionInfo, + RangeIntervalPartitioner partitioner, Object filterValue, + boolean isGreaterThan, boolean isEqualTo, + DateFormat timestampFormatter, DateFormat dateFormatter) { + + List<String> values = partitionInfo.getRangeInfo(); + DataType partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + + Comparator comparator = + PartitionFilterUtil.getComparatorByDataType(partitionColumnDataType); + + BitSet partitionMap = PartitionUtil + .generateBitSetBySize(partitioner.numPartitions(), false); + + int numPartitions = values.size() - 1; + int result = 0; + // the partition index of filter value + int partitionIndex = 0; + // find the partition of filter value + for (; partitionIndex < numPartitions; partitionIndex++) { + result = comparator.compare(filterValue, PartitionUtil.getDataBasedOnDataType( + values.get(partitionIndex), partitionColumnDataType, timestampFormatter, dateFormatter)); + if (result <= 0) { + break; + } + } + if (partitionIndex == numPartitions) { + // filter value is not in given partition, should get partitionId dynamically + int partitionId = partitioner.getPartition(filterValue); --- End diff -- this should be partitionIndex --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126327873 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/partition/PartitionFilterUtil.java --- @@ -264,4 +265,81 @@ public static BitSet getPartitionMapForRangeFilter(PartitionInfo partitionInfo, return partitionMap; } + /** + * get partition map of range interval filter on range interval partition table + * @param partitionInfo + * @param partitioner + * @param filterValue + * @param isGreaterThan + * @param isEqualTo + * @return + */ + public static BitSet getPartitionMapForRangeIntervalFilter(PartitionInfo partitionInfo, + RangeIntervalPartitioner partitioner, Object filterValue, + boolean isGreaterThan, boolean isEqualTo, + DateFormat timestampFormatter, DateFormat dateFormatter) { + + List<String> values = partitionInfo.getRangeInfo(); + DataType partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + + Comparator comparator = + PartitionFilterUtil.getComparatorByDataType(partitionColumnDataType); + + BitSet partitionMap = PartitionUtil + .generateBitSetBySize(partitioner.numPartitions(), false); + + int numPartitions = values.size() - 1; + int result = 0; + // the partition index of filter value + int partitionIndex = 0; + // find the partition of filter value + for (; partitionIndex < numPartitions; partitionIndex++) { + result = comparator.compare(filterValue, PartitionUtil.getDataBasedOnDataType( + values.get(partitionIndex), partitionColumnDataType, timestampFormatter, dateFormatter)); + if (result <= 0) { + break; + } + } + if (partitionIndex == numPartitions) { + // filter value is not in given partition, should get partitionId dynamically + int partitionId = partitioner.getPartition(filterValue); + partitionMap.set(0); + if (isGreaterThan) { + // GreaterThan(>), GreaterThanEqualTo(>=) + partitionMap.set(partitionId, partitioner.numPartitions()); --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126327928 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/partition/RangeIntervalPartitioner.java --- @@ -0,0 +1,206 @@ +/* + * 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.core.scan.partition; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.schema.PartitionInfo; +import org.apache.carbondata.core.util.CarbonProperties; + +/** + * Range Interval Partitioner + */ + +public class RangeIntervalPartitioner implements Partitioner { + + private int numPartitions; + private RangeIntervalComparator comparator; + private List<Object> boundsList = new ArrayList<>(); + private String intervalType; + private DataType partitionColumnDataType; + + private SimpleDateFormat timestampFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, + CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)); + + private SimpleDateFormat dateFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, + CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)); + + public RangeIntervalPartitioner(PartitionInfo partitionInfo) { + List<String> values = partitionInfo.getRangeIntervalInfo(); + partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + numPartitions = values.size() - 1; + // -1 is just for instead of null + boundsList.add(-1L); + for (int i = 0; i < numPartitions; i++) { + boundsList.add(PartitionUtil.getDataBasedOnDataType(values.get(i), partitionColumnDataType, + timestampFormatter, dateFormatter)); + } + comparator = new RangeIntervalComparator(); + intervalType = values.get(numPartitions); + } + + @Override public int numPartitions() { + String numParStr = CarbonProperties.getInstance().getProperty( + CarbonCommonConstants.MAX_PARTITION_FOR_RANGE_INTERVAL, + CarbonCommonConstants.DEFAULT_MAX_PARTITION_FOR_RANGE_INTERVAL); + return Integer.parseInt(numParStr); + } + + @Override public int getPartition(Object key) { + int partitionIndex = -1; + Object lastBound = boundsList.get(boundsList.size() - 1); + if (key == null) { + return 0; + } else { + for (int i = 1; i <= numPartitions; i++) { + if (comparator.compareTo(key, boundsList.get(i))) { + return i; + } + } + switch (intervalType.toLowerCase()) { + case "year": + partitionIndex = getDynamicPartitionForYear(key, lastBound); + break; + case "month": + partitionIndex = getDynamicPartitionForMonth(key, lastBound); + break; + case "week": + partitionIndex = getDynamicPartitionForWeek(key, lastBound); + break; + case "day": + partitionIndex = getDynamicPartitionForDay(key, lastBound); + break; + case "hour": + partitionIndex = getDynamicPartitionForHour(key, lastBound); + break; + default: + partitionIndex = -1; + } + // if value's partitionId is great than max partition, return 0 for it. + if (partitionIndex >= numPartitions()) { + return 0; + } + return partitionIndex; + } + } + + public int getDynamicPartitionForYear(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.YEAR, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForMonth(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126327975 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/partition/RangeIntervalPartitioner.java --- @@ -0,0 +1,206 @@ +/* + * 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.core.scan.partition; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.schema.PartitionInfo; +import org.apache.carbondata.core.util.CarbonProperties; + +/** + * Range Interval Partitioner + */ + +public class RangeIntervalPartitioner implements Partitioner { + + private int numPartitions; + private RangeIntervalComparator comparator; + private List<Object> boundsList = new ArrayList<>(); + private String intervalType; + private DataType partitionColumnDataType; + + private SimpleDateFormat timestampFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, + CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)); + + private SimpleDateFormat dateFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, + CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)); + + public RangeIntervalPartitioner(PartitionInfo partitionInfo) { + List<String> values = partitionInfo.getRangeIntervalInfo(); + partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + numPartitions = values.size() - 1; + // -1 is just for instead of null + boundsList.add(-1L); + for (int i = 0; i < numPartitions; i++) { + boundsList.add(PartitionUtil.getDataBasedOnDataType(values.get(i), partitionColumnDataType, + timestampFormatter, dateFormatter)); + } + comparator = new RangeIntervalComparator(); + intervalType = values.get(numPartitions); + } + + @Override public int numPartitions() { + String numParStr = CarbonProperties.getInstance().getProperty( + CarbonCommonConstants.MAX_PARTITION_FOR_RANGE_INTERVAL, + CarbonCommonConstants.DEFAULT_MAX_PARTITION_FOR_RANGE_INTERVAL); + return Integer.parseInt(numParStr); + } + + @Override public int getPartition(Object key) { + int partitionIndex = -1; + Object lastBound = boundsList.get(boundsList.size() - 1); + if (key == null) { + return 0; + } else { + for (int i = 1; i <= numPartitions; i++) { + if (comparator.compareTo(key, boundsList.get(i))) { + return i; + } + } + switch (intervalType.toLowerCase()) { + case "year": + partitionIndex = getDynamicPartitionForYear(key, lastBound); + break; + case "month": + partitionIndex = getDynamicPartitionForMonth(key, lastBound); + break; + case "week": + partitionIndex = getDynamicPartitionForWeek(key, lastBound); + break; + case "day": + partitionIndex = getDynamicPartitionForDay(key, lastBound); + break; + case "hour": + partitionIndex = getDynamicPartitionForHour(key, lastBound); + break; + default: + partitionIndex = -1; + } + // if value's partitionId is great than max partition, return 0 for it. + if (partitionIndex >= numPartitions()) { + return 0; + } + return partitionIndex; + } + } + + public int getDynamicPartitionForYear(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.YEAR, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126327993 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/partition/RangeIntervalPartitioner.java --- @@ -0,0 +1,206 @@ +/* + * 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.core.scan.partition; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.schema.PartitionInfo; +import org.apache.carbondata.core.util.CarbonProperties; + +/** + * Range Interval Partitioner + */ + +public class RangeIntervalPartitioner implements Partitioner { + + private int numPartitions; + private RangeIntervalComparator comparator; + private List<Object> boundsList = new ArrayList<>(); + private String intervalType; + private DataType partitionColumnDataType; + + private SimpleDateFormat timestampFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, + CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)); + + private SimpleDateFormat dateFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, + CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)); + + public RangeIntervalPartitioner(PartitionInfo partitionInfo) { + List<String> values = partitionInfo.getRangeIntervalInfo(); + partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + numPartitions = values.size() - 1; + // -1 is just for instead of null + boundsList.add(-1L); + for (int i = 0; i < numPartitions; i++) { + boundsList.add(PartitionUtil.getDataBasedOnDataType(values.get(i), partitionColumnDataType, + timestampFormatter, dateFormatter)); + } + comparator = new RangeIntervalComparator(); + intervalType = values.get(numPartitions); + } + + @Override public int numPartitions() { + String numParStr = CarbonProperties.getInstance().getProperty( + CarbonCommonConstants.MAX_PARTITION_FOR_RANGE_INTERVAL, + CarbonCommonConstants.DEFAULT_MAX_PARTITION_FOR_RANGE_INTERVAL); + return Integer.parseInt(numParStr); + } + + @Override public int getPartition(Object key) { + int partitionIndex = -1; + Object lastBound = boundsList.get(boundsList.size() - 1); + if (key == null) { + return 0; + } else { + for (int i = 1; i <= numPartitions; i++) { + if (comparator.compareTo(key, boundsList.get(i))) { + return i; + } + } + switch (intervalType.toLowerCase()) { + case "year": + partitionIndex = getDynamicPartitionForYear(key, lastBound); + break; + case "month": + partitionIndex = getDynamicPartitionForMonth(key, lastBound); + break; + case "week": + partitionIndex = getDynamicPartitionForWeek(key, lastBound); + break; + case "day": + partitionIndex = getDynamicPartitionForDay(key, lastBound); + break; + case "hour": + partitionIndex = getDynamicPartitionForHour(key, lastBound); + break; + default: + partitionIndex = -1; + } + // if value's partitionId is great than max partition, return 0 for it. + if (partitionIndex >= numPartitions()) { + return 0; + } + return partitionIndex; + } + } + + public int getDynamicPartitionForYear(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.YEAR, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForMonth(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForWeek(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.WEEK_OF_MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126328001 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/partition/RangeIntervalPartitioner.java --- @@ -0,0 +1,206 @@ +/* + * 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.core.scan.partition; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.schema.PartitionInfo; +import org.apache.carbondata.core.util.CarbonProperties; + +/** + * Range Interval Partitioner + */ + +public class RangeIntervalPartitioner implements Partitioner { + + private int numPartitions; + private RangeIntervalComparator comparator; + private List<Object> boundsList = new ArrayList<>(); + private String intervalType; + private DataType partitionColumnDataType; + + private SimpleDateFormat timestampFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, + CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)); + + private SimpleDateFormat dateFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, + CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)); + + public RangeIntervalPartitioner(PartitionInfo partitionInfo) { + List<String> values = partitionInfo.getRangeIntervalInfo(); + partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + numPartitions = values.size() - 1; + // -1 is just for instead of null + boundsList.add(-1L); + for (int i = 0; i < numPartitions; i++) { + boundsList.add(PartitionUtil.getDataBasedOnDataType(values.get(i), partitionColumnDataType, + timestampFormatter, dateFormatter)); + } + comparator = new RangeIntervalComparator(); + intervalType = values.get(numPartitions); + } + + @Override public int numPartitions() { + String numParStr = CarbonProperties.getInstance().getProperty( + CarbonCommonConstants.MAX_PARTITION_FOR_RANGE_INTERVAL, + CarbonCommonConstants.DEFAULT_MAX_PARTITION_FOR_RANGE_INTERVAL); + return Integer.parseInt(numParStr); + } + + @Override public int getPartition(Object key) { + int partitionIndex = -1; + Object lastBound = boundsList.get(boundsList.size() - 1); + if (key == null) { + return 0; + } else { + for (int i = 1; i <= numPartitions; i++) { + if (comparator.compareTo(key, boundsList.get(i))) { + return i; + } + } + switch (intervalType.toLowerCase()) { + case "year": + partitionIndex = getDynamicPartitionForYear(key, lastBound); + break; + case "month": + partitionIndex = getDynamicPartitionForMonth(key, lastBound); + break; + case "week": + partitionIndex = getDynamicPartitionForWeek(key, lastBound); + break; + case "day": + partitionIndex = getDynamicPartitionForDay(key, lastBound); + break; + case "hour": + partitionIndex = getDynamicPartitionForHour(key, lastBound); + break; + default: + partitionIndex = -1; + } + // if value's partitionId is great than max partition, return 0 for it. + if (partitionIndex >= numPartitions()) { + return 0; + } + return partitionIndex; + } + } + + public int getDynamicPartitionForYear(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.YEAR, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForMonth(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForWeek(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.WEEK_OF_MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForDay(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.DAY_OF_WEEK, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126328012 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/partition/RangeIntervalPartitioner.java --- @@ -0,0 +1,206 @@ +/* + * 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.core.scan.partition; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.schema.PartitionInfo; +import org.apache.carbondata.core.util.CarbonProperties; + +/** + * Range Interval Partitioner + */ + +public class RangeIntervalPartitioner implements Partitioner { + + private int numPartitions; + private RangeIntervalComparator comparator; + private List<Object> boundsList = new ArrayList<>(); + private String intervalType; + private DataType partitionColumnDataType; + + private SimpleDateFormat timestampFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, + CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)); + + private SimpleDateFormat dateFormatter = new SimpleDateFormat(CarbonProperties.getInstance() + .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, + CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)); + + public RangeIntervalPartitioner(PartitionInfo partitionInfo) { + List<String> values = partitionInfo.getRangeIntervalInfo(); + partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + numPartitions = values.size() - 1; + // -1 is just for instead of null + boundsList.add(-1L); + for (int i = 0; i < numPartitions; i++) { + boundsList.add(PartitionUtil.getDataBasedOnDataType(values.get(i), partitionColumnDataType, + timestampFormatter, dateFormatter)); + } + comparator = new RangeIntervalComparator(); + intervalType = values.get(numPartitions); + } + + @Override public int numPartitions() { + String numParStr = CarbonProperties.getInstance().getProperty( + CarbonCommonConstants.MAX_PARTITION_FOR_RANGE_INTERVAL, + CarbonCommonConstants.DEFAULT_MAX_PARTITION_FOR_RANGE_INTERVAL); + return Integer.parseInt(numParStr); + } + + @Override public int getPartition(Object key) { + int partitionIndex = -1; + Object lastBound = boundsList.get(boundsList.size() - 1); + if (key == null) { + return 0; + } else { + for (int i = 1; i <= numPartitions; i++) { + if (comparator.compareTo(key, boundsList.get(i))) { + return i; + } + } + switch (intervalType.toLowerCase()) { + case "year": + partitionIndex = getDynamicPartitionForYear(key, lastBound); + break; + case "month": + partitionIndex = getDynamicPartitionForMonth(key, lastBound); + break; + case "week": + partitionIndex = getDynamicPartitionForWeek(key, lastBound); + break; + case "day": + partitionIndex = getDynamicPartitionForDay(key, lastBound); + break; + case "hour": + partitionIndex = getDynamicPartitionForHour(key, lastBound); + break; + default: + partitionIndex = -1; + } + // if value's partitionId is great than max partition, return 0 for it. + if (partitionIndex >= numPartitions()) { + return 0; + } + return partitionIndex; + } + } + + public int getDynamicPartitionForYear(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.YEAR, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForMonth(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForWeek(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.WEEK_OF_MONTH, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForDay(Object key, Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.DAY_OF_WEEK, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; + } + + public int getDynamicPartitionForHour(Object key , Object lastBound) { + int partitionId = -1; + Calendar lastCalendar = Calendar.getInstance(); + Calendar keyCal = Calendar.getInstance(); + keyCal.setTimeInMillis((long)key); + lastCalendar.setTimeInMillis((long)lastBound); + while (true) { + lastCalendar.add(Calendar.HOUR_OF_DAY, 1); + boundsList.add(boundsList.size(), lastCalendar.getTimeInMillis()); + ++numPartitions; + if (keyCal.compareTo(lastCalendar) == -1) { + partitionId = numPartitions; + break; + } + } + return partitionId; --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1105#discussion_r126328284 --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/partition/PartitionFilterUtil.java --- @@ -264,4 +265,81 @@ public static BitSet getPartitionMapForRangeFilter(PartitionInfo partitionInfo, return partitionMap; } + /** + * get partition map of range interval filter on range interval partition table + * @param partitionInfo + * @param partitioner + * @param filterValue + * @param isGreaterThan + * @param isEqualTo + * @return + */ + public static BitSet getPartitionMapForRangeIntervalFilter(PartitionInfo partitionInfo, + RangeIntervalPartitioner partitioner, Object filterValue, + boolean isGreaterThan, boolean isEqualTo, + DateFormat timestampFormatter, DateFormat dateFormatter) { + + List<String> values = partitionInfo.getRangeInfo(); + DataType partitionColumnDataType = partitionInfo.getColumnSchemaList().get(0).getDataType(); + + Comparator comparator = + PartitionFilterUtil.getComparatorByDataType(partitionColumnDataType); + + BitSet partitionMap = PartitionUtil + .generateBitSetBySize(partitioner.numPartitions(), false); + + int numPartitions = values.size() - 1; + int result = 0; + // the partition index of filter value + int partitionIndex = 0; + // find the partition of filter value + for (; partitionIndex < numPartitions; partitionIndex++) { + result = comparator.compare(filterValue, PartitionUtil.getDataBasedOnDataType( + values.get(partitionIndex), partitionColumnDataType, timestampFormatter, dateFormatter)); + if (result <= 0) { + break; + } + } + if (partitionIndex == numPartitions) { + // filter value is not in given partition, should get partitionId dynamically + int partitionId = partitioner.getPartition(filterValue); --- End diff -- this should be partition index --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
Free forum by Nabble | Edit this page |