question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom type mapping for logical types

See original GitHub issue

Iis there a way to specify custom type mapping for logical types?

For example I’ve got schema with date and timestamp_ms logical types which are currently generated to java.time.LocalDate and java.time.LocalDateTime

I’d like be able to customize that generation to java.sql.Date and java.sql.Timestamp (because of apache spark limitation)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DaimonPlcommented, Aug 6, 2018

Works great, thx! 😃

0reactions
julianpeeterscommented, Aug 6, 2018

Sorry for the delay @DaimonPl, this should be available to try in avrhohugger version 1.0.0-RC12 and sbt-avrohugger version 2.0.0-RC12, at Sonatype now, and syncing with maven central shortly.

example use in sbt-avrohugger:

avroScalaCustomTypes in Compile := {
  avrohugger.format.Standard.defaultTypes.copy(
    date = avrohugger.types.JavaSqlDate,
    timestampMillis = avrohugger.types.JavaSqlTimestamp)
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing Datatype Mappings - ER/Studio Data Architect
Use the Datatype Mapping Editor to customize the datatype mapping as you move your logical models to physical models. Choose Tools > Datatype...
Read more >
Custom Type Handling. Go beyond Dapper limits and map…
Custom Type Handling. Go beyond Dapper limits and map arbitrary complex class. To map — or better — deserialize data coming from your...
Read more >
Randomic error "Custom type mapping for ... is not specified or ...
The randomic error seems to occur because of the mapping between Oracle types and .NET types mechanism. As described in the following links,...
Read more >
Configuring Custom Types · Confluent schema registry
Configuring Custom Types. Schemas can contain types that cannot be represented by Javascript primitive types, or where there's more than one possible type...
Read more >
Map Logical Data Types to Physical Data Types
The Data Type Standards Editor lets you map logical data types to physical data types, which is useful when you want to derive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found