Skip to content

Commit

Permalink
Add inline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfgem committed Jan 10, 2024
1 parent f6392ac commit 9bcd0bf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ private static Schema basicSqlTypeToAvroType(BasicSqlType relDataType) {
schema.addProp("logicalType", "timestamp-millis");
return schema;
case DATE:
// Spark recognizes the data type of {"type": "int", "logicalType": "date"} as a date type:
// https://github.com/apache/spark/blob/master/connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala#L145
schema = Schema.create(Schema.Type.INT);
schema.addProp("logicalType", "date");
return schema;
Expand Down

0 comments on commit 9bcd0bf

Please sign in to comment.