Skip to content

Commit 3577caf

Browse files
committed
Temporary get the workaround back for TIMESTAMP field in jdbc.
1 parent 6d0e00e commit 3577caf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
from apache_beam.testing.test_pipeline import TestPipeline
3737
from apache_beam.testing.util import assert_that
3838
from apache_beam.testing.util import equal_to
39+
from apache_beam.typehints.schemas import LogicalType
40+
from apache_beam.typehints.schemas import MillisInstant
3941
from apache_beam.utils.timestamp import Timestamp
4042

4143
# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
@@ -239,6 +241,10 @@ def test_xlang_jdbc_write_read(self, database):
239241

240242
config = self.jdbc_configs[database]
241243

244+
# Register MillisInstant logical type to override the mapping from Timestamp
245+
# originally handled by MicrosInstant.
246+
LogicalType.register_logical_type(MillisInstant)
247+
242248
with TestPipeline() as p:
243249
p.not_use_test_runner_api = True
244250
_ = (
@@ -349,6 +355,10 @@ def custom_row_equals(expected, actual):
349355
classpath=config['classpath'],
350356
))
351357

358+
# Register MillisInstant logical type to override the mapping from Timestamp
359+
# originally handled by MicrosInstant.
360+
LogicalType.register_logical_type(MillisInstant)
361+
352362
# Run read pipeline with custom schema
353363
with TestPipeline() as p:
354364
p.not_use_test_runner_api = True

0 commit comments

Comments
 (0)