Avro with Java 8 dates as logical type

后端 未结 4 1632
北恋
北恋 2020-12-30 02:50

Latest Avro compiler (1.8.2) generates java sources for dates logical types with Joda-Time based implementations. How can I configure Avro compiler to produce sources that u

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 03:45

    With avro 1.9.2 you can use e.g. date for LocalDate:

        {
          "name": "Transaction",
          "type": "record",
          "fields": [
            {
              "name": "time",
              "type": {
                "type": "int",
                "logicalType": "date"
              }
            },
    

    See Logical Types for the other types.

提交回复
热议问题