few-carpenter-93837
08/16/2022, 8:41 AM'warnings': {'XSCHEMA.YTABLE': ['unable to get column information due to an error -> __init__() got an unexpected keyword ' "argument 'precision'"]}
This issue is raised from the following code in source\sql\vertica.py:
elif attype in ("timestamptz", "timetz"):
kwargs["timezone"] = True
if charlen:
kwargs["precision"] = int(charlen) # type: ignore
args = () # type: ignore
elif attype in ("timestamp", "time"):
kwargs["timezone"] = False
if charlen:
kwargs["precision"] = int(charlen) # type: ignore
Which leads to the point that TIMESTAMP imported from sqlalchemy.sql.sqltypes import TIME, TIMESTAMP, String
is missing the parameter precision: https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.DateTime
One of the solutions would be to add
self.precision = precision
into the
class TIMESTAMP(DateTime):
in \Lib\site-packages\sqlalchemy\sql\sqltypes.py
Which results in the correct output
{
"fieldPath": "DATE_CREATED",
"jsonPath": null,
"nullable": true,
"description": null,
"created": null,
"lastModified": null,
"type": {
"type": {
"com.linkedin.pegasus2avro.schema.TimeType": {}
}
},
"nativeDataType": "TIMESTAMP(precision=0)",
"recursive": false,
"globalTags": null,
"glossaryTerms": null,
"isPartOfKey": false,
"isPartitioningKey": null,
"jsonProps": null
}
Since the fix is in sqlalchemy files, how to implement this to datahub code instead?dazzling-judge-80093
08/16/2022, 8:52 AMfew-carpenter-93837
08/18/2022, 5:34 AMfew-carpenter-93837
08/23/2022, 7:25 AM