You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/06/30 04:41:50 UTC
[GitHub] [spark] LuciferYang opened a new pull request, #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
LuciferYang opened a new pull request, #37030:
URL: https://github.com/apache/spark/pull/37030
### What changes were proposed in this pull request?
This pr move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`.
### Why are the changes needed?
Code refactor, `ColumnVectorUtils.allocateColumns` method introduced in https://github.com/apache/spark/pull/36616 only be used by `VectorizedParquetRecordReader`, no need to put it into the helper class
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Pass GitHub Actions
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #37030:
URL: https://github.com/apache/spark/pull/37030#discussion_r911656508
##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java:
##########
@@ -415,4 +417,36 @@ private void initColumnReader(PageReadStore pages, ParquetColumnVector cv) throw
}
}
}
+
+ /**
+ * <b>This method assumes that all constant column are at the end of schema
+ * and `constantColumnLength` represents the number of constant column.<b/>
+ *
+ * This method allocates columns to store elements of each field of the schema,
+ * the data columns use `OffHeapColumnVector` when `useOffHeap` is true and
+ * use `OnHeapColumnVector` when `useOffHeap` is false, the constant columns
+ * always use `ConstantColumnVector`.
+ *
+ * Capacity is the initial capacity of the vector, and it will grow as necessary.
+ * Capacity is in number of elements, not number of bytes.
+ */
+ private ColumnVector[] allocateColumns(
Review Comment:
OK ~
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sunchao commented on a diff in pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
sunchao commented on code in PR #37030:
URL: https://github.com/apache/spark/pull/37030#discussion_r911650372
##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java:
##########
@@ -415,4 +417,36 @@ private void initColumnReader(PageReadStore pages, ParquetColumnVector cv) throw
}
}
}
+
+ /**
+ * <b>This method assumes that all constant column are at the end of schema
+ * and `constantColumnLength` represents the number of constant column.<b/>
+ *
+ * This method allocates columns to store elements of each field of the schema,
+ * the data columns use `OffHeapColumnVector` when `useOffHeap` is true and
+ * use `OnHeapColumnVector` when `useOffHeap` is false, the constant columns
+ * always use `ConstantColumnVector`.
+ *
+ * Capacity is the initial capacity of the vector, and it will grow as necessary.
+ * Capacity is in number of elements, not number of bytes.
+ */
+ private ColumnVector[] allocateColumns(
Review Comment:
nit: we can make it static?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sunchao commented on pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
sunchao commented on PR #37030:
URL: https://github.com/apache/spark/pull/37030#issuecomment-1171992707
Merged to master, thanks!
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sunchao commented on a diff in pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
sunchao commented on code in PR #37030:
URL: https://github.com/apache/spark/pull/37030#discussion_r911654987
##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java:
##########
@@ -415,4 +417,36 @@ private void initColumnReader(PageReadStore pages, ParquetColumnVector cv) throw
}
}
}
+
+ /**
+ * <b>This method assumes that all constant column are at the end of schema
+ * and `constantColumnLength` represents the number of constant column.<b/>
+ *
+ * This method allocates columns to store elements of each field of the schema,
+ * the data columns use `OffHeapColumnVector` when `useOffHeap` is true and
+ * use `OnHeapColumnVector` when `useOffHeap` is false, the constant columns
+ * always use `ConstantColumnVector`.
+ *
+ * Capacity is the initial capacity of the vector, and it will grow as necessary.
+ * Capacity is in number of elements, not number of bytes.
+ */
+ private ColumnVector[] allocateColumns(
Review Comment:
Yea, it doesn't matter much in this case, mostly just a code style thing. I'm fine with `private` too.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on PR #37030:
URL: https://github.com/apache/spark/pull/37030#issuecomment-1171993715
thanks @sunchao
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sunchao closed pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
sunchao closed pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
URL: https://github.com/apache/spark/pull/37030
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on PR #37030:
URL: https://github.com/apache/spark/pull/37030#issuecomment-1171853161
cc @sunchao
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #37030: [SPARK-39231][SQL][FOLLOWUP] Move `ColumnVectorUtils.allocateColumns` to `VectorizedParquetRecordReader`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #37030:
URL: https://github.com/apache/spark/pull/37030#discussion_r911652425
##########
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java:
##########
@@ -415,4 +417,36 @@ private void initColumnReader(PageReadStore pages, ParquetColumnVector cv) throw
}
}
}
+
+ /**
+ * <b>This method assumes that all constant column are at the end of schema
+ * and `constantColumnLength` represents the number of constant column.<b/>
+ *
+ * This method allocates columns to store elements of each field of the schema,
+ * the data columns use `OffHeapColumnVector` when `useOffHeap` is true and
+ * use `OnHeapColumnVector` when `useOffHeap` is false, the constant columns
+ * always use `ConstantColumnVector`.
+ *
+ * Capacity is the initial capacity of the vector, and it will grow as necessary.
+ * Capacity is in number of elements, not number of bytes.
+ */
+ private ColumnVector[] allocateColumns(
Review Comment:
Yes, but what are the benefits of static? I didn't think clearly
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org