You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "zhli1142015 (via GitHub)" <gi...@apache.org> on 2024/06/11 02:29:04 UTC
[PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
zhli1142015 opened a new pull request, #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036
## What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
(Fixes: \#ISSUE-ID)
## How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "rui-mo (via GitHub)" <gi...@apache.org>.
rui-mo commented on code in PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#discussion_r1635632730
##########
backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala:
##########
@@ -1077,4 +1077,25 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}
}
+
+ test("PreciseTimestampConversion") {
+ withTempPath {
+ path =>
+ val df = spark
+ .sql(
+ "select * from VALUES ('A1', TIMESTAMP'2021-01-01 00:00:00'), " +
+ "('A1', TIMESTAMP'2021-01-01 00:04:30'), ('A1', TIMESTAMP'2021-01-01 00:06:00'), " +
+ "('A2', TIMESTAMP'2021-01-01 00:01:00') AS tab(a, b)")
+ .write
+ .parquet(path.getCanonicalPath)
+
+ spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("string_timestamp")
+
+ runQueryAndCompare(
+ "SELECT a, window.start, window.end, count(*) as cnt FROM" +
+ " string_timestamp GROUP by a, window(b, '5 minutes') ORDER BY a, start;") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
Review Comment:
Is the round-trip conversion tested in this test?
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#issuecomment-2159654156
<!--
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/LICEGJ-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.
-->
Thanks for opening a pull request!
Could you open an issue for this pull request on Github Issues?
https://github.com/apache/incubator-gluten/issues
Then could you also rename ***commit message*** and ***pull request title*** in the following format?
[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}
See also:
* [Other pull requests](https://github.com/apache/incubator-gluten/pulls/)
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 commented on PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#issuecomment-2185521082
> `knownnullable`
Thanks for reproting this. I think `KnownNullable` is already supported by https://github.com/apache/incubator-gluten/pull/5365/files, but not portable to spark 3.5, let me fix it and also test.
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 commented on code in PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#discussion_r1635727579
##########
backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala:
##########
@@ -1077,4 +1077,25 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}
}
+
+ test("PreciseTimestampConversion") {
+ withTempPath {
+ path =>
+ val df = spark
+ .sql(
+ "select * from VALUES ('A1', TIMESTAMP'2021-01-01 00:00:00'), " +
+ "('A1', TIMESTAMP'2021-01-01 00:04:30'), ('A1', TIMESTAMP'2021-01-01 00:06:00'), " +
+ "('A2', TIMESTAMP'2021-01-01 00:01:00') AS tab(a, b)")
+ .write
+ .parquet(path.getCanonicalPath)
+
+ spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("string_timestamp")
+
+ runQueryAndCompare(
+ "SELECT a, window.start, window.end, count(*) as cnt FROM" +
+ " string_timestamp GROUP by a, window(b, '5 minutes') ORDER BY a, start;") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
Review Comment:
Yes, below is the fallback before this change.
```
(9) Project [codegen id : 2]
Output [2]: [named_struct(start, knownnullable(precisetimestampconversion(((precisetimestampconversion(b#28, TimestampType, LongType) - CASE WHEN (((precisetimestampconversion(b#28, TimestampType, LongType) - 0) % 300000000) < 0) THEN (((precisetimestampconversion(b#28, TimestampType, LongType) - 0) % 300000000) + 300000000) ELSE ((precisetimestampconversion(b#28, TimestampType, LongType) - 0) % 300000000) END) - 0), LongType, TimestampType)), end, knownnullable(precisetimestampconversion((((precisetimestampconversion(b#28, TimestampType, LongType) - CASE WHEN (((precisetimestampconversion(b#28, TimestampType, LongType) - 0) % 300000000) < 0) THEN (((precisetimestampconversion(b#28, TimestampType, LongType) - 0) % 300000000) + 300000000) ELSE ((precisetimestampconversion(b#28, TimestampType, LongType) - 0) % 300000000) END) - 0) + 300000000), LongType, TimestampType))) AS window#33, a#27]
Input [2]: [a#27, b#28]
```
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "rui-mo (via GitHub)" <gi...@apache.org>.
rui-mo commented on code in PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#discussion_r1635632730
##########
backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala:
##########
@@ -1077,4 +1077,25 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}
}
+
+ test("PreciseTimestampConversion") {
+ withTempPath {
+ path =>
+ val df = spark
+ .sql(
+ "select * from VALUES ('A1', TIMESTAMP'2021-01-01 00:00:00'), " +
+ "('A1', TIMESTAMP'2021-01-01 00:04:30'), ('A1', TIMESTAMP'2021-01-01 00:06:00'), " +
+ "('A2', TIMESTAMP'2021-01-01 00:01:00') AS tab(a, b)")
+ .write
+ .parquet(path.getCanonicalPath)
+
+ spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("string_timestamp")
+
+ runQueryAndCompare(
+ "SELECT a, window.start, window.end, count(*) as cnt FROM" +
+ " string_timestamp GROUP by a, window(b, '5 minutes') ORDER BY a, start;") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
Review Comment:
Is the round-trip conversion tested in this unit test?
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 merged PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 commented on PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#issuecomment-2159866678
cc @rui-mo and @PHILO-HE , 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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#issuecomment-2185510139
This test cannot test if the function is used.
Because `knownnullable` is not supported, so the function fallback, it just check `(8) ProjectExecTransformer [a#143, window#169.start AS start#170, window#169.end AS end#171, count(1)#168L AS cnt#167L]`
The plan is
```
VeloxColumnarToRowExec
+- ^(9) SortExecTransformer [a#143 ASC NULLS FIRST, start#170 ASC NULLS FIRST], true, 0
+- ^(9) InputIteratorTransformer[a#143, start#170, end#171, cnt#167L]
+- ShuffleQueryStage 1
+- ColumnarExchange rangepartitioning(a#143 ASC NULLS FIRST, start#170 ASC NULLS FIRST, 1), ENSURE_REQUIREMENTS, [plan_id=633], [id=#633], [OUTPUT] List(a:StringType, start:TimestampType, end:TimestampType, cnt:LongType), [OUTPUT] List(a:StringType, start:TimestampType, end:TimestampType, cnt:LongType)
+- ^(8) ProjectExecTransformer [a#143, window#169.start AS start#170, window#169.end AS end#171, count(1)#168L AS cnt#167L]
+- ^(8) HashAggregateTransformer(keys=[a#143, window#169], functions=[count(1)], output=[a#143, window#169, count(1)#168L])
+- ^(8) InputIteratorTransformer[a#143, window#169, count#179L]
+- RowToVeloxColumnar
+- ShuffleQueryStage 0
+- Exchange hashpartitioning(a#143, window#169, 1), ENSURE_REQUIREMENTS, [plan_id=567]
+- VeloxColumnarToRowExec
+- ^(7) FlushableHashAggregateTransformer(keys=[a#143, window#169], functions=[partial_count(1)], output=[a#143, window#169, count#179L])
+- ^(7) InputIteratorTransformer[window#169, a#143]
+- RowToVeloxColumnar
+- *(2) Project [named_struct(start, knownnullable(precisetimestampconversion(((precisetimestampconversion(b#144, TimestampType, LongType) - CASE WHEN (((precisetimestampconversion(b#144, TimestampType, LongType) - 0) % 300000000) < cast(0 as bigint)) THEN (((precisetimestampconversion(b#144, TimestampType, LongType) - 0) % 300000000) + 300000000) ELSE ((precisetimestampconversion(b#144, TimestampType, LongType) - 0) % 300000000) END) - 0), LongType, TimestampType)), end, knownnullable(precisetimestampconversion((((precisetimestampconversion(b#144, TimestampType, LongType) - CASE WHEN (((precisetimestampconversion(b#144, TimestampType, LongType) - 0) % 300000000) < cast(0 as bigint)) THEN (((precisetimestampconversion(b#144, TimestampType, LongType) - 0) % 300000000) + 300000000) ELSE ((precisetimestampconversion(b#144, TimestampType, LongType) - 0) % 300000000) END) - 0) + 300000000), LongType, TimestampType))) AS window#169, a#143]
+- VeloxColumnarToRowExec
+- ^(6) FilterExecTransformer isnotnull(b#144)
+- ^(6) InputIteratorTransformer[a#143, b#144]
+- RowToVeloxColumnar
+- *(1) ColumnarToRow
+- BatchScan parquet file:/tmp/spark-3ebf1be6-44e8-4f33-a661-3540f556
```
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#issuecomment-2159654400
Run Gluten Clickhouse CI
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support PreciseTimestampConversion function [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #6036:
URL: https://github.com/apache/incubator-gluten/pull/6036#issuecomment-2185525404
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org