Abacn commented on code in PR #22561:
URL: https://github.com/apache/beam/pull/22561#discussion_r941638166
##########
sdks/python/apache_beam/typehints/schemas.py:
##########
@@ -647,9 +648,36 @@ def _from_typing(cls, typ):
('micros', np.int64)])
[email protected]_logical_type
+class DateTimeLogicalType(NoArgumentLogicalType[Timestamp, np.int64]):
Review Comment:
The change in JdbcUtil and Python are for different purposes. Basically
there are two things missing for java<->portable timestamp: (1) Java JDBCIO
support of portable timestamp; (2) Python support for java timestamp.
The JdbcUtil change is for write to jdbc. It adds support in Java's JDBCIO
of converting portable timestamp type (beam:logical_type:micros_instant:v1) to
sql timestamp;
The Python coder and schema change is for read from jdbc. It adds supports
in Python's RowCoder of identifying (by schema change) and decoding (by coder
change) the java timestamp type (datetime) to language timestamp. The field
'beam:logical_type:datetime:v1' is passed from java
[here](https://github.com/apache/beam/blob/4799828f75309fd494e14eab5af40559e9a140a3/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/SchemaTranslation.java#L201)
when the row contains datetime field type.
--
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]