You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/05 21:23:49 UTC
[GitHub] [arrow-datafusion] NGA-TRAN opened a new pull request, #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
NGA-TRAN opened a new pull request, #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520
While working on PR #4490 that implements `PREPARE stmt`, I found that I need to pass the provided data types of the parameters/binding down to the plan's expressions to map data types to $1, $2, ...
@alamb has suggested me to pass datatypes of the parameters along with the CTEs. This PR is just a refactor to convert `ctes` from a hash map to a struct that store both ctes (hahhmap) and the params' data types.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] NGA-TRAN commented on a diff in pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
NGA-TRAN commented on code in PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#discussion_r1040111329
##########
datafusion/sql/src/planner.rs:
##########
@@ -103,6 +103,31 @@ pub struct ParserOptions {
parse_float_as_decimal: bool,
}
+#[derive(Debug, Clone)]
+/// Struct to store Common Table Expression provided with WITH clause and Parameter Data Types provided with PREPARE statement
+pub struct Ctes {
+ /// Data type provided with prepare statement
+ pub prepare_param_data_types: Vec<DataType>,
+ /// Map of CTE name to logical plan of the WITH clause
+ pub ctes: HashMap<String, LogicalPlan>,
+}
+
+impl Default for Ctes {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl Ctes {
+ /// Create a new Ctes
+ pub fn new() -> Self {
+ Self {
+ prepare_param_data_types: vec![],
Review Comment:
This is always empty in this PR. After this is merged, I will use and set it in PR #4490
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
jackwener commented on code in PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#discussion_r1040839567
##########
datafusion/sql/src/planner.rs:
##########
@@ -103,6 +103,31 @@ pub struct ParserOptions {
parse_float_as_decimal: bool,
}
+#[derive(Debug, Clone)]
+/// Struct to store Common Table Expression provided with WITH clause and Parameter Data Types provided with PREPARE statement
+pub struct Ctes {
+ /// Data type provided with prepare statement
+ pub prepare_param_data_types: Vec<DataType>,
+ /// Map of CTE name to logical plan of the WITH clause
+ pub ctes: HashMap<String, LogicalPlan>,
+}
Review Comment:
I think use a struct to store CTE info is a good idea
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
alamb commented on PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#issuecomment-1339177195
> cc @alamb , we need to retrigger the CI
I have retriggered -- hopefully it will complete soon
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb merged pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
alamb merged PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] ursabot commented on pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#issuecomment-1339644947
Benchmark runs are scheduled for baseline = d9a47d681a2ac370ad46f773f8193a21cde1192e and contender = bfd41a3ff718c4fbfd128cdf1c01f41795431743. bfd41a3ff718c4fbfd128cdf1c01f41795431743 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/7e19faf6b4a7455997c06ce086ce30dc...ec25d0eeabc3431e80326e4b34483f59/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/4b55af0ad6fb430b98e643fa6b290bd9...ea7a24b04e8f4e6e9f27f60afde9edd0/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/4a2bf0f79dc34a31949161cd3adbb45a...aa6cf3ec19994901818cb91b4c3596ae/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/2ba629ee1c934d929619415ab6b83cfb...3e8d4c3283fb4e769c2fc404865aa4da/)
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] NGA-TRAN commented on a diff in pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
NGA-TRAN commented on code in PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#discussion_r1041074514
##########
datafusion/sql/src/planner.rs:
##########
@@ -103,6 +103,31 @@ pub struct ParserOptions {
parse_float_as_decimal: bool,
}
+#[derive(Debug, Clone)]
+/// Struct to store Common Table Expression provided with WITH clause and Parameter Data Types provided with PREPARE statement
+pub struct Ctes {
Review Comment:
Yes, I will use PlannerContext
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#discussion_r1040843955
##########
datafusion/sql/src/planner.rs:
##########
@@ -103,6 +103,31 @@ pub struct ParserOptions {
parse_float_as_decimal: bool,
}
+#[derive(Debug, Clone)]
+/// Struct to store Common Table Expression provided with WITH clause and Parameter Data Types provided with PREPARE statement
Review Comment:
```suggestion
/// Struct to store Common Table Expression (CTE) provided with WITH clause and Parameter Data Types provided with PREPARE statement
```
##########
datafusion/sql/src/planner.rs:
##########
@@ -103,6 +103,31 @@ pub struct ParserOptions {
parse_float_as_decimal: bool,
}
+#[derive(Debug, Clone)]
+/// Struct to store Common Table Expression provided with WITH clause and Parameter Data Types provided with PREPARE statement
+pub struct Ctes {
Review Comment:
What do you think about calling this `PlannerState` or `PlannerContext` rather than `Ctes` as will contain more than CTEs?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
jackwener commented on code in PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#discussion_r1040839567
##########
datafusion/sql/src/planner.rs:
##########
@@ -103,6 +103,31 @@ pub struct ParserOptions {
parse_float_as_decimal: bool,
}
+#[derive(Debug, Clone)]
+/// Struct to store Common Table Expression provided with WITH clause and Parameter Data Types provided with PREPARE statement
+pub struct Ctes {
+ /// Data type provided with prepare statement
+ pub prepare_param_data_types: Vec<DataType>,
+ /// Map of CTE name to logical plan of the WITH clause
+ pub ctes: HashMap<String, LogicalPlan>,
+}
Review Comment:
I think use a struct to store CTE info is a good idea👍
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] jackwener commented on pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
jackwener commented on PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#issuecomment-1339174604
Look like `Github` is unstable today😂.
cc @alamb , we need to retrigger the 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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] NGA-TRAN commented on pull request #4520: refactor: make Ctes a struct to also store data types provided by prepare stmt
Posted by GitBox <gi...@apache.org>.
NGA-TRAN commented on PR #4520:
URL: https://github.com/apache/arrow-datafusion/pull/4520#issuecomment-1339542702
Thanks @alamb and @jackwener. I have addressed all your comments.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org