Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema DDL: add support for 'date' format #256

Closed
wants to merge 1 commit into from

Conversation

miike
Copy link

@miike miike commented Jun 26, 2017

This adds support for suggesting a Redshift DATE type when specifying "format": "date" in a JSON schema.

It's not entirely clear as to what is the best way to support a date with no time component as date was present in JSON schema v3 but removed in later versions. In v4 the spec mentions that anything with "format": "date-time" should meet section 5.6 of RFC3339 but the ABNF for "date-time" suggests that both a full date and a full time are required
date-time = full-date "T" full-time this differs from the ISO8601 which allows for partial dates. Thoughts @chuwy @alexanderdean?

@snowplowcla
Copy link

@miike has signed the CLA.

@alexanderdean
Copy link
Member

alexanderdean commented Jun 26, 2017

Thanks for this @miike - I was schema'ing Northwind the other day and was wishing for a DATE mapping (https://github.com/snowplow/iglu-central/pull/611/files).

It's not entirely clear as to what is the best way to support a date with no time component as date was present

My view is that we should pretend format: date is still available in v4, and we should expect YYYY-MM-DD. Thoughts @chuwy?

@chuwy
Copy link
Contributor

chuwy commented Jun 26, 2017

I absolutely agree - we should support it.

Even further, according to v4 - it is up to to validator app to implement custom formats. Which means we're absolutely free to add custom validators with formats like date, file-path, json-path, iglu-uri etc. to our schema-validation code. Third-party validators that don't understand these formats according to specification must simply ignore them, but in Snowplow/Iglu stack this should drastically simplify things and add some safety.

See #170

@alexanderdean alexanderdean added this to the Release 7 Stamp TBC milestone Jun 26, 2017
@alexanderdean
Copy link
Member

Great, scheduling

@oguzhanunlu oguzhanunlu changed the title Add support for 'date' format Schema DDL: add support for 'date' format Nov 21, 2017
@oguzhanunlu
Copy link
Member

Cherry-picked to #280 .

@oguzhanunlu oguzhanunlu mentioned this pull request Nov 21, 2017
32 tasks
rzats pushed a commit to snowplow/schema-ddl that referenced this pull request Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants