waitingkuo opened a new pull request, #4069:
URL: https://github.com/apache/arrow-datafusion/pull/4069
# Which issue does this PR close?
Closes #4067
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in
the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your
changes and offer better suggestions for fixes.
-->
to support
```bash
SET [VARIABLE] [TO | =] [VALUE | 'VALUE']
```
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
support u64 value
```bash
❯ set datafusion.execution.batch_size = 1;
0 rows in set. Query took 0.001 seconds.
❯ show datafusion.execution.batch_size;
+---------------------------------+---------+
| name | setting |
+---------------------------------+---------+
| datafusion.execution.batch_size | 1 |
+---------------------------------+---------+
1 row in set. Query took 0.013 seconds.
```
support bool
```bash
❯ set datafusion.execution.coalesce_batches to false;
0 rows in set. Query took 0.000 seconds.
❯ show datafusion.execution.coalesce_batches;
+---------------------------------------+---------+
| name | setting |
+---------------------------------------+---------+
| datafusion.execution.coalesce_batches | false |
+---------------------------------------+---------+
1 row in set. Query took 0.007 seconds.
```
support single quoted string
```bash
❯ set datafusion.execution.coalesce_batches to 'false';
0 rows in set. Query took 0.000 seconds.
❯ show datafusion.execution.coalesce_batches;
+---------------------------------------+---------+
| name | setting |
+---------------------------------------+---------+
| datafusion.execution.coalesce_batches | false |
+---------------------------------------+---------+
1 row in set. Query took 0.007 seconds.
```
support alias `TIME ZONE` and `TIMEZONE`
as discussed in
https://github.com/apache/arrow-datafusion/issues/3148#issuecomment-1226105182
we disallow `set timezone` for now until timezone integration is full
completed
```bash
❯ set time zone = 1;
Plan("Changing Time Zone isn't supported yet")
```
throw error for unknown variable
```bash
❯ set abc = 1;
Execution("Unknown Variable abc")
```
throw error for incorrect data type
```bash
❯ set datafusion.execution.batch_size = a;
Execution("Failed to parse a as u64")
```
```bash
❯ set datafusion.execution.batch_size = -1;
Execution("Failed to parse -1 as u64")
```
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]