You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "shunping (via GitHub)" <gi...@apache.org> on 2025/06/11 16:46:39 UTC
[PR] Fix a logical type issue about JdbcDateType [beam]
shunping opened a new pull request, #35243:
URL: https://github.com/apache/beam/pull/35243
**Please** add a meaningful description for your change here
------------------------
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] Fix a logical type issue about JdbcDateType [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2963736667
Assigning reviewers:
R: @tvalentyn for label python.
Note: If you would like to opt out of this review, comment `assign to next reviewer`.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review 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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2964061331
To run this test, just remove this line in the test, make any change to https://github.com/apache/beam/blob/master/.github/trigger_files/beam_PostCommit_Python.json and push a commit to this PR
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2966152301
@Abacn, could you please take another look? 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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2964811406
Ok - I'll remind @shunping after tests pass
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2161408122
##########
sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py:
##########
@@ -255,10 +253,6 @@ def test_xlang_jdbc_write_read(self, database):
classpath=config['classpath'],
))
- # Register MillisInstant logical type to override the mapping from Timestamp
- # originally handled by MicrosInstant.
- LogicalType.register_logical_type(MillisInstant)
Review Comment:
Hmmm, removing that line is the main purpose of this PR. Let's revert the PR for now and I will take a look at that failed test later.
--
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] Fix a logical type issue about JdbcDateType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2140860817
##########
sdks/python/apache_beam/typehints/schemas.py:
##########
@@ -808,6 +811,11 @@ def from_runner_api(cls, logical_type_proto):
return logical_type()
return logical_type(argument)
+ @classmethod
+ def is_known_logical_type(cls, logical_type):
+ return cls._known_logical_types.get_urn_by_logial_type(
Review Comment:
Nice catch!
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2161580240
##########
sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py:
##########
@@ -255,10 +253,6 @@ def test_xlang_jdbc_write_read(self, database):
classpath=config['classpath'],
))
- # Register MillisInstant logical type to override the mapping from Timestamp
- # originally handled by MicrosInstant.
- LogicalType.register_logical_type(MillisInstant)
Review Comment:
The way I understand it is your fix avoids the need for using this to workaround to work withdate (beam:logical_type:javasdk_date:v1) and time (beam:logical_type:javasdk_time:v1) types.
For jdbc timestamp types, java encodes as beam:logical_type:millis_instant:v1, which python interprets as a language type Timestamp, but MicrosInstant is registered to handle timestamps?
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2994720249
Here is one
```
ValueError: Error decoding input stream with coder WindowedValueCoder[window_coder=GlobalWindowCoder, value_coder=RowCoder]
self = <apache_beam.runners.worker.bundle_processor.DataInputOperation object at 0x7917f5f45d60>
encoded_windowed_values = b'\x7f\xdf;dZ\x1c\xac\t\x00\x00\x00\x01\x0fQ\x0b\x00\xfd\xff\xff\xff\x0f\xfd\xff\xff\xff\xff\xff\xff\xff\xff\x01?\xb9\...\x05Test9\x05Test9\x05Test9\x80\x00\x01\x97{"\xe0C\x02\x02\x037\x80\x00\x00@t\x17p\x00\x80\x00\x00\x00\x01\xf6\xc3\x11'
def process_encoded(self, encoded_windowed_values: bytes) -> None:
input_stream = coder_impl.create_InputStream(encoded_windowed_values)
while input_stream.size() > 0:
with self.splitting_lock:
if self.index == self.stop - 1:
return
self.index += 1
try:
> decoded_value = self.windowed_coder_impl.decode_from_stream(
input_stream, True)
apache_beam/runners/worker/bundle_processor.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/coders/coder_impl.py:1549: in decode_from_stream
value = self._value_coder.decode_from_stream(in_stream, nested)
apache_beam/coders/coder_impl.py:1641: in decode_from_stream
return self._value_coder.decode(in_stream.read(value_length))
apache_beam/coders/coder_impl.py:239: in decode
return self.decode_from_stream(create_InputStream(encoded), False)
apache_beam/coders/coder_impl.py:1952: in decode_from_stream
item = component_coder.decode_from_stream(in_stream, True)
apache_beam/coders/coder_impl.py:2005: in decode_from_stream
return self.logical_type.to_language_type(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <apache_beam.typehints.schemas.MicrosInstant object at 0x79182e358fa0>
value = BeamSchema_ee15bbf4_32de_4611_a9dc_b1b5c5981f57(seconds=None, micros=None)
def to_language_type(self, value):
# type: (MicrosInstantRepresentation) -> Timestamp
> return Timestamp(seconds=int(value.seconds), micros=int(value.micros))
E TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
apache_beam/typehints/schemas.py:934: TypeError
The above exception was the direct cause of the following exception:
a = (<apache_beam.io.external.xlang_jdbcio_it_test.CrossLanguageJdbcIOTest testMethod=test_xlang_jdbc_write_read_0_postgres>,)
kw = {}
@wraps(func)
def standalone_func(*a, **kw):
> return func(*(a + p.args), **p.kwargs, **kw)
../../build/gradleenv/1398941893/lib/python3.9/site-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/io/external/xlang_jdbcio_it_test.py:268: in test_xlang_jdbc_write_read
assert_that(result, equal_to(expected_rows))
apache_beam/pipeline.py:661: in __exit__
self.result = self.run()
apache_beam/testing/test_pipeline.py:115: in run
result = super().run(
apache_beam/pipeline.py:635: in run
return self.runner.run_pipeline(self, self._options)
apache_beam/runners/direct/test_direct_runner.py:42: in run_pipeline
self.result = super().run_pipeline(pipeline, options)
apache_beam/runners/direct/direct_runner.py:185: in run_pipeline
return runner.run_pipeline(pipeline, options)
apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
apache_beam/runners/portability/fn_api_runner/worker_handlers.py:389: in push
response = self.worker.do_instruction(request)
apache_beam/runners/worker/sdk_worker.py:657: in do_instruction
return getattr(self, request_type)(
apache_beam/runners/worker/sdk_worker.py:695: in process_bundle
bundle_processor.process_bundle(instruction_id))
apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <apache_beam.runners.worker.bundle_processor.DataInputOperation object at 0x7917f5f45d60>
encoded_windowed_values = b'\x7f\xdf;dZ\x1c\xac\t\x00\x00\x00\x01\x0fQ\x0b\x00\xfd\xff\xff\xff\x0f\xfd\xff\xff\xff\xff\xff\xff\xff\xff\x01?\xb9\...\x05Test9\x05Test9\x05Test9\x80\x00\x01\x97{"\xe0C\x02\x02\x037\x80\x00\x00@t\x17p\x00\x80\x00\x00\x00\x01\xf6\xc3\x11'
def process_encoded(self, encoded_windowed_values: bytes) -> None:
input_stream = coder_impl.create_InputStream(encoded_windowed_values)
while input_stream.size() > 0:
with self.splitting_lock:
if self.index == self.stop - 1:
return
self.index += 1
try:
decoded_value = self.windowed_coder_impl.decode_from_stream(
input_stream, True)
except Exception as exn:
> raise ValueError(
"Error decoding input stream with coder " +
str(self.windowed_coder)) from exn
E ValueError: Error decoding input stream with coder WindowedValueCoder[window_coder=GlobalWindowCoder, value_coder=RowCoder]
apache_beam/runners/worker/bundle_processor.py:234: ValueError
```
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2964808792
remind me after tests pass
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2966151605
I checked and verified that the failure is not related to the change 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] Fix a logical type issue about JdbcDateType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2140857702
##########
sdks/python/apache_beam/io/jdbc.py:
##########
@@ -401,7 +401,7 @@ def __init__(self, argument=""):
@classmethod
def representation_type(cls) -> type:
- return Timestamp
+ return MillisInstant
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2994645519
I think this PR is causing failures in the xlang direct tests https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml?page=2
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "akashorabek (via GitHub)" <gi...@apache.org>.
akashorabek commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2161523545
##########
sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py:
##########
@@ -255,10 +253,6 @@ def test_xlang_jdbc_write_read(self, database):
classpath=config['classpath'],
))
- # Register MillisInstant logical type to override the mapping from Timestamp
- # originally handled by MicrosInstant.
- LogicalType.register_logical_type(MillisInstant)
Review Comment:
I created a [PR](https://github.com/apache/beam/pull/35396) that reverts this one and [#35191](https://github.com/apache/beam/pull/35191), which also contributed to the failures of PostCommit Python XLang GCP Direct.
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2963983384
> xlang_jdbcio_it_test.py
> Can you confirm the tests now work without this line?
>
> https://github.com/apache/beam/blob/7f09169252a77dcef024104a7ee9fb5c2717c4bc/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py#L260
I didn't run this test, but I have some local ones that has a similar logic. Like the one in #35244. They failed previous to my change with the same error, and now they run successfully.
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2963961288
Can you confirm the tests now work without this line?
https://github.com/apache/beam/blob/7f09169252a77dcef024104a7ee9fb5c2717c4bc/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py#L260
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35243:
URL: https://github.com/apache/beam/pull/35243#issuecomment-2994710887
> I think this PR is causing failures in the xlang direct tests https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml?page=2
>
> @shunping
Do you see the error messages? I checked but they are not very useful.
We can try to revert this PR and run xlang postcommit and see if it passes.
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2161737747
##########
sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py:
##########
@@ -255,10 +253,6 @@ def test_xlang_jdbc_write_read(self, database):
classpath=config['classpath'],
))
- # Register MillisInstant logical type to override the mapping from Timestamp
- # originally handled by MicrosInstant.
- LogicalType.register_logical_type(MillisInstant)
Review Comment:
So the two logical types `MillisInstant` (https://github.com/apache/beam/blob/5532af8438fca1bcffc221a2b9394dc31c342425/sdks/python/apache_beam/typehints/schemas.py#L867) and `MicrosInstant` (https://github.com/apache/beam/blob/5532af8438fca1bcffc221a2b9394dc31c342425/sdks/python/apache_beam/typehints/schemas.py#L911) both register `Timestamp` as their language type and `MillisInstant` goes first and then `MicrosIntant` goes second in the file.
There is a map internally to map a language type to its logical type and it is used when it tries to determine the coder. Without my fix and the workaround, the internal map is going to map `Timestamp` to `MicroInstant`.
Then the whole code path when determining the coder of `MillisInstant` will be `MillisInstant` -> `TimeStamp` -> Logical Type of `TimeStamp` -> `MicroInstant` and its representation type.
The workaround is to calling the register function again for `MillisInstant`, so that it overwrite the internal mapping to `Timestamp` -> `Millistant`.
My fix was trying to eliminate the need of the workaround.
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2162113182
##########
sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py:
##########
@@ -255,10 +253,6 @@ def test_xlang_jdbc_write_read(self, database):
classpath=config['classpath'],
))
- # Register MillisInstant logical type to override the mapping from Timestamp
- # originally handled by MicrosInstant.
- LogicalType.register_logical_type(MillisInstant)
Review Comment:
When we read from jdbc, we get a schema with a millis_instant urn e.g.
```
fields {
name: "created_at"
type {
nullable: true
logical_type {
urn: "beam:logical_type:millis_instant:v1"
representation {
atomic_type: INT64
}
}
}
id: 2
encoding_position: 2
}
```
Then in named_tuple_from_schema we try map the schema fields to python types https://github.com/apache/beam/blob/0d6c94a8727627ee295a13b1736ceda4137f8aa3/sdks/python/apache_beam/typehints/schemas.py#L541.
```
[('created_at', typing.Optional[apache_beam.typehints.schemas.Timestamp])]
```
The coder for this tuple will use MicrosInstant because that was registered last for Timestamp.
I am testing a fix here to use a stub type so that
beam:logical_type:millis_instant:v1 -> Stub Type -> MillisInstant -> Timestamp
https://github.com/apache/beam/pull/35400
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping merged PR #35243:
URL: https://github.com/apache/beam/pull/35243
--
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] Fix a logical type issue about JdbcDateType and JdbcTimeType [beam]
Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2160625111
##########
sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py:
##########
@@ -255,10 +253,6 @@ def test_xlang_jdbc_write_read(self, database):
classpath=config['classpath'],
))
- # Register MillisInstant logical type to override the mapping from Timestamp
- # originally handled by MicrosInstant.
- LogicalType.register_logical_type(MillisInstant)
Review Comment:
I think we need to add this back?
--
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] Fix a logical type issue about JdbcDateType [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2140845580
##########
sdks/python/apache_beam/typehints/schemas.py:
##########
@@ -808,6 +811,11 @@ def from_runner_api(cls, logical_type_proto):
return logical_type()
return logical_type(argument)
+ @classmethod
+ def is_known_logical_type(cls, logical_type):
+ return cls._known_logical_types.get_urn_by_logial_type(
Review Comment:
`logial` has a typo
--
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] Fix a logical type issue about JdbcDateType [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #35243:
URL: https://github.com/apache/beam/pull/35243#discussion_r2140834046
##########
sdks/python/apache_beam/io/jdbc.py:
##########
@@ -401,7 +401,7 @@ def __init__(self, argument=""):
@classmethod
def representation_type(cls) -> type:
- return Timestamp
+ return MillisInstant
Review Comment:
JdbcTimeType below had same arrangement, consider fix both
--
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