Skip to content

Missing handling of Timestamp Without Timezone type  #2244

Closed

Description

@RussellSpitzer

Spark currently possess no readers for the Timestamp.withoutZone() type but is able to create tables with this schema. These tables if you attempt to read them from Spark will error out.

Currently in master the only reader for this type that I can see is for the generic case

case TIMESTAMP:
return GenericOrcReaders.timestamps();

Other systems if they hit a table with this type will fail immediately since they do not have valid readers.

This is a bit troubling because this column type is used by default when non-iceberg ORC writers make new files, for example:

spark.sql("CREATE EXTERNAL TABLE mytable (foo timestamp) location '/Users/russellspitzer/Temp/foo'")

spark.sql("INSERT INTO mytable VALUES (now())")


Creates files

File Version: 0.12 with ORC_135
Rows: 1
Compression: SNAPPY
Compression size: 262144
Calendar: Julian/Gregorian
Type: struct<foo:timestamp>

The non-iceberg Spark and Hive Orc readers and writers have no problem dealing with these files but, if an iceberg table is created and these files are added to it then they are unreadable by Iceberg's orc readers and writers.

There is also a related problem with Migrate -- @RussellSpitzer Add Link Here

Activity

  1. RussellSpitzer commented on Feb 26, 2021

    @RussellSpitzer
    MemberAuthor

    We decided in the last Sync that a reasonable solution here would be for Spark to read both timezone types as timestamp with timezone with a flag disabling this behavior by default. If the flag is disabled an error message would alert the user that Spark cannot handle the two different types and will always display the local timezone, but the underlying data would be correct.

  2. javsanbel2 commented on Mar 9, 2021

    @javsanbel2

    Hello @RussellSpitzer! I am having a similar issue and I agree to your solution as well. Did you continue working on this? I would like to know more about your approach. How would this work in practice?

  3. RussellSpitzer commented on Mar 9, 2021

    @RussellSpitzer
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions