You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "Polber (via GitHub)" <gi...@apache.org> on 2024/04/08 22:19:28 UTC
[PR] [yaml] backtick generated aliases on sql mappings [beam]
Polber opened a new pull request, #30895:
URL: https://github.com/apache/beam/pull/30895
There are cases where `MapToFields` does not work for sql expressions where a field in the incoming schema is a reserved keyword.
For example, with an input schema of
`{foo: int, timestamp: str}`
The following would fail:
```
- type: MapToFields
config:
language: sql
append: true
fields:
newField: foo
```
as the generated query is
`SELECT (timestamp) AS timestamp, (foo) AS foo, (foo) AS newField FROM PCOLLECTION.`
where `(timestamp) AS timestamp` was generated due to `append: true` being set.
---
This PR provides a fix by auto-escaping aliases that are generated by the framework such as the example above, or when naming a field, i.e.
```
- type: MapToFields
name: Transform
config:
language: sql
fields:
timestamp: foo
```
Note: The expression itself will not be auto-backticked, so the following is still expected to fail:
```
- type: MapToFields
config:
language: sql
fields:
foo: timestamp
```
a user would be expected to write valid SQL, i.e.
```
- type: MapToFields
config:
language: sql
fields:
foo: "`timestamp`"
```
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1567565392
##########
website/www/site/content/en/documentation/sdks/yaml-udf.md:
##########
@@ -133,11 +184,26 @@ expressions are supported as well
another_col: "col2 + col3"
```
+keeping in mind that any fields not intended to be included in the output should be added to the `drop` field.
+
+If one wanted to select a field that collides with a[reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded inbackticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
Review Comment:
Done.
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1559821133
##########
sdks/python/apache_beam/yaml/tests/maptofields.yaml:
##########
@@ -0,0 +1,62 @@
+#
+# 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# Row(word='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# Row(word='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.
+#
+
+pipelines:
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - {label: "11a", timestamp: 0}
+ - {label: "37a", timestamp: 1}
+ - {label: "389a", timestamp: 2}
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ fields:
+ label_copy: label
+ - type: AssertEqual
+ config:
+ elements:
+ - { label: "11a", timestamp: 0, label_copy: "11a" }
+ - { label: "37a", timestamp: 1, label_copy: "37a" }
+ - { label: "389a", timestamp: 2, label_copy: "389a" }
+
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - { label: "11a", rank: 0 }
+ - { label: "37a", rank: 1 }
+ - { label: "389a", rank: 2 }
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ drop: [ rank ]
+ fields:
+ timestamp: "`rank`"
Review Comment:
Is there a reason we can't just auto-backtick this as well? Is it basically so that we can support valid SQL expressions?
We should probably add to the docs what is/isn't acceptable here
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1559945902
##########
sdks/python/apache_beam/yaml/tests/maptofields.yaml:
##########
@@ -0,0 +1,62 @@
+#
+# 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# Row(word='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# Row(word='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.
+#
+
+pipelines:
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - {label: "11a", timestamp: 0}
+ - {label: "37a", timestamp: 1}
+ - {label: "389a", timestamp: 2}
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ fields:
+ label_copy: label
+ - type: AssertEqual
+ config:
+ elements:
+ - { label: "11a", timestamp: 0, label_copy: "11a" }
+ - { label: "37a", timestamp: 1, label_copy: "37a" }
+ - { label: "389a", timestamp: 2, label_copy: "389a" }
+
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - { label: "11a", rank: 0 }
+ - { label: "37a", rank: 1 }
+ - { label: "389a", rank: 2 }
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ drop: [ rank ]
+ fields:
+ timestamp: "`rank`"
Review Comment:
what is the error message when this happens? Do we tell users know how to fix it?
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1559842734
##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -515,7 +515,7 @@ def normalize_fields(pcoll, fields, drop=(), append=False, language='generic'):
if append:
return input_schema, {
- **{name: name
+ **{name: f'`{name}`' if language == 'sql' else name
Review Comment:
Added some tests
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm merged PR #30895:
URL: https://github.com/apache/beam/pull/30895
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1567555783
##########
sdks/python/apache_beam/yaml/tests/maptofields.yaml:
##########
@@ -0,0 +1,62 @@
+#
+# 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# Row(word='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# Row(word='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.
+#
+
+pipelines:
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - {label: "11a", timestamp: 0}
+ - {label: "37a", timestamp: 1}
+ - {label: "389a", timestamp: 2}
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ fields:
+ label_copy: label
+ - type: AssertEqual
+ config:
+ elements:
+ - { label: "11a", timestamp: 0, label_copy: "11a" }
+ - { label: "37a", timestamp: 1, label_copy: "37a" }
+ - { label: "389a", timestamp: 2, label_copy: "389a" }
+
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - { label: "11a", rank: 0 }
+ - { label: "37a", rank: 1 }
+ - { label: "389a", rank: 2 }
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ drop: [ rank ]
+ fields:
+ timestamp: "`rank`"
Review Comment:
Just the generic SQL syntax error thrown by SQLTransform which I think makes sense given that it needs to be valid SQL (which is also documented now)
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1559858954
##########
sdks/python/apache_beam/yaml/tests/maptofields.yaml:
##########
@@ -0,0 +1,62 @@
+#
+# 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# Row(word='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# Row(word='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.
+#
+
+pipelines:
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - {label: "11a", timestamp: 0}
+ - {label: "37a", timestamp: 1}
+ - {label: "389a", timestamp: 2}
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ fields:
+ label_copy: label
+ - type: AssertEqual
+ config:
+ elements:
+ - { label: "11a", timestamp: 0, label_copy: "11a" }
+ - { label: "37a", timestamp: 1, label_copy: "37a" }
+ - { label: "389a", timestamp: 2, label_copy: "389a" }
+
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - { label: "11a", rank: 0 }
+ - { label: "37a", rank: 1 }
+ - { label: "389a", rank: 2 }
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ drop: [ rank ]
+ fields:
+ timestamp: "`rank`"
Review Comment:
Right, if someone has a schema that contains a reserved keyword, we don't want to override the function by auto-backticking in case they actually wanted to perform that function on a different field (or the same).
As far as documenting, I'm in agreement the more docs, the better, but I'm not really sure what would need to be explicitly called out here. The query is a **valid** SQL statement (i.e. reserved keywords are escaped when using as column names), and this PR doesn't really change that. It just makes it to where the YAML tags work as expected
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on PR #30895:
URL: https://github.com/apache/beam/pull/30895#issuecomment-2043737188
R: @damccorm
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #30895:
URL: https://github.com/apache/beam/pull/30895#issuecomment-2043738129
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1559934667
##########
sdks/python/apache_beam/yaml/tests/maptofields.yaml:
##########
@@ -0,0 +1,62 @@
+#
+# 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# Row(word='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# Row(word='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.
+#
+
+pipelines:
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - {label: "11a", timestamp: 0}
+ - {label: "37a", timestamp: 1}
+ - {label: "389a", timestamp: 2}
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ fields:
+ label_copy: label
+ - type: AssertEqual
+ config:
+ elements:
+ - { label: "11a", timestamp: 0, label_copy: "11a" }
+ - { label: "37a", timestamp: 1, label_copy: "37a" }
+ - { label: "389a", timestamp: 2, label_copy: "389a" }
+
+ - pipeline:
+ type: chain
+ transforms:
+ - type: Create
+ config:
+ elements:
+ - { label: "11a", rank: 0 }
+ - { label: "37a", rank: 1 }
+ - { label: "389a", rank: 2 }
+ - type: MapToFields
+ config:
+ language: sql
+ append: true
+ drop: [ rank ]
+ fields:
+ timestamp: "`rank`"
Review Comment:
On second thought, I added some more docs as they were lacking a lot of valuable information.
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1563185528
##########
website/www/site/content/en/documentation/sdks/yaml-udf.md:
##########
@@ -133,11 +184,26 @@ expressions are supported as well
another_col: "col2 + col3"
```
+keeping in mind that any fields not intended to be included in the output should be added to the `drop` field.
+
+If one wanted to select a field that collides with a[reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded inbackticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
Review Comment:
Note there are also now conflicts which need resolved
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1563185014
##########
website/www/site/content/en/documentation/sdks/yaml-udf.md:
##########
@@ -133,11 +184,26 @@ expressions are supported as well
another_col: "col2 + col3"
```
+keeping in mind that any fields not intended to be included in the output should be added to the `drop` field.
+
+If one wanted to select a field that collides with a[reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded inbackticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
Review Comment:
FYI, this is still pending (and blocking merging)
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on PR #30895:
URL: https://github.com/apache/beam/pull/30895#issuecomment-2043736968
R: @robertwb
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1556512365
##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -515,7 +515,7 @@ def normalize_fields(pcoll, fields, drop=(), append=False, language='generic'):
if append:
return input_schema, {
- **{name: name
+ **{name: f'`{name}`' if language == 'sql' else name
Review Comment:
looks like these issues should be easily caught with some tests. So can we add more tests?
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1559946822
##########
website/www/site/content/en/documentation/sdks/yaml-udf.md:
##########
@@ -133,11 +184,26 @@ expressions are supported as well
another_col: "col2 + col3"
```
+keeping in mind that any fields not intended to be included in the output should be added to the `drop` field.
+
+If one wanted to select a field that collides with a[reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded inbackticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
Review Comment:
```suggestion
If one wanted to select a field that collides with a [reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded in backticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
```
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [yaml] backtick generated aliases on sql mappings [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #30895:
URL: https://github.com/apache/beam/pull/30895#discussion_r1567703399
##########
website/www/site/content/en/documentation/sdks/yaml-udf.md:
##########
@@ -133,11 +184,26 @@ expressions are supported as well
another_col: "col2 + col3"
```
+keeping in mind that any fields not intended to be included in the output should be added to the `drop` field.
+
+If one wanted to select a field that collides with a[reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded in backticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
Review Comment:
```suggestion
If one wanted to select a field that collides with a [reserved SQL keyword](https://calcite.apache.org/docs/reference.html#keywords), the field(s) must be surrounded in backticks. For example, say the incoming PCollection has a field "timestamp", one would have to write:
```
I'm just going to apply this so that it gets in before the cut
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org