forked from ZJONSSON/parquetjs
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add schema test for millis, macros and nanos
- Loading branch information
1 parent
abf7f0b
commit 0a5040f
Showing
8 changed files
with
422 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$id": "https://example.com/time-micros.schema.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "A schema to test the TIME logical type in Parquet with MICROS unit", | ||
"type": "object", | ||
"properties": { | ||
"time_field": { | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"type": "number", | ||
"description": "Time value in MICROS" | ||
}, | ||
"unit": { | ||
"type": "string", | ||
"enum": ["MICROS"], | ||
"description": "The unit is fixed to MICROS" | ||
}, | ||
"isAdjustedToUTC": { | ||
"type": "boolean", | ||
"description": "Whether the time is adjusted to UTC" | ||
} | ||
}, | ||
"required": ["value", "isAdjustedToUTC"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["time_field"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"schema": { | ||
"time_field": { | ||
"optional": false, | ||
"type": "INT64", | ||
"logicalType": { | ||
"STRING": null, | ||
"MAP": null, | ||
"LIST": null, | ||
"ENUM": null, | ||
"DECIMAL": null, | ||
"DATE": null, | ||
"TIME": { | ||
"isAdjustedToUTC": false, | ||
"unit": { | ||
"MILLIS": null, | ||
"MICROS": {}, | ||
"NANOS": null | ||
} | ||
}, | ||
"TIMESTAMP": null, | ||
"INTEGER": null, | ||
"UNKNOWN": null, | ||
"JSON": null, | ||
"BSON": null, | ||
"UUID": null | ||
}, | ||
"encoding": "PLAIN", | ||
"compression": "UNCOMPRESSED" | ||
} | ||
}, | ||
"fields": { | ||
"time_field": { | ||
"name": "time_field", | ||
"primitiveType": "INT64", | ||
"originalType": "TIME_MICROS", | ||
"logicalType": { | ||
"STRING": null, | ||
"MAP": null, | ||
"LIST": null, | ||
"ENUM": null, | ||
"DECIMAL": null, | ||
"DATE": null, | ||
"TIME": { | ||
"isAdjustedToUTC": false, | ||
"unit": { | ||
"MILLIS": null, | ||
"MICROS": {}, | ||
"NANOS": null | ||
} | ||
}, | ||
"TIMESTAMP": null, | ||
"INTEGER": null, | ||
"UNKNOWN": null, | ||
"JSON": null, | ||
"BSON": null, | ||
"UUID": null | ||
}, | ||
"path": ["time_field"], | ||
"repetitionType": "REQUIRED", | ||
"encoding": "PLAIN", | ||
"compression": "UNCOMPRESSED", | ||
"rLevelMax": 0, | ||
"dLevelMax": 0 | ||
} | ||
}, | ||
"fieldList": [ | ||
{ | ||
"name": "time_field", | ||
"primitiveType": "INT64", | ||
"originalType": "TIME_MICROS", | ||
"logicalType": { | ||
"STRING": null, | ||
"MAP": null, | ||
"LIST": null, | ||
"ENUM": null, | ||
"DECIMAL": null, | ||
"DATE": null, | ||
"TIME": { | ||
"isAdjustedToUTC": false, | ||
"unit": { | ||
"MILLIS": null, | ||
"MICROS": {}, | ||
"NANOS": null | ||
} | ||
}, | ||
"TIMESTAMP": null, | ||
"INTEGER": null, | ||
"UNKNOWN": null, | ||
"JSON": null, | ||
"BSON": null, | ||
"UUID": null | ||
}, | ||
"path": ["time_field"], | ||
"repetitionType": "REQUIRED", | ||
"encoding": "PLAIN", | ||
"compression": "UNCOMPRESSED", | ||
"rLevelMax": 0, | ||
"dLevelMax": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$id": "https://example.com/time-millis.schema.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "A schema to test the TIME logical type in Parquet with MILLIS unit", | ||
"type": "object", | ||
"properties": { | ||
"time_field": { | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"type": "number", | ||
"description": "Time value in MILLIS" | ||
}, | ||
"unit": { | ||
"type": "string", | ||
"enum": ["MILLIS"], | ||
"description": "The unit is fixed to MILLIS" | ||
}, | ||
"isAdjustedToUTC": { | ||
"type": "boolean", | ||
"description": "Whether the time is adjusted to UTC" | ||
} | ||
}, | ||
"required": ["value", "isAdjustedToUTC"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["time_field"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"schema": { | ||
"time_field": { | ||
"optional": false, | ||
"type": "INT32", | ||
"logicalType": { | ||
"STRING": null, | ||
"MAP": null, | ||
"LIST": null, | ||
"ENUM": null, | ||
"DECIMAL": null, | ||
"DATE": null, | ||
"TIME": { | ||
"isAdjustedToUTC": false, | ||
"unit": { | ||
"MILLIS": {}, | ||
"MICROS": null, | ||
"NANOS": null | ||
} | ||
}, | ||
"TIMESTAMP": null, | ||
"INTEGER": null, | ||
"UNKNOWN": null, | ||
"JSON": null, | ||
"BSON": null, | ||
"UUID": null | ||
}, | ||
"encoding": "PLAIN", | ||
"compression": "UNCOMPRESSED" | ||
} | ||
}, | ||
"fields": { | ||
"time_field": { | ||
"name": "time_field", | ||
"primitiveType": "INT32", | ||
"originalType": "TIME_MILLIS", | ||
"logicalType": { | ||
"STRING": null, | ||
"MAP": null, | ||
"LIST": null, | ||
"ENUM": null, | ||
"DECIMAL": null, | ||
"DATE": null, | ||
"TIME": { | ||
"isAdjustedToUTC": false, | ||
"unit": { | ||
"MILLIS": {}, | ||
"MICROS": null, | ||
"NANOS": null | ||
} | ||
}, | ||
"TIMESTAMP": null, | ||
"INTEGER": null, | ||
"UNKNOWN": null, | ||
"JSON": null, | ||
"BSON": null, | ||
"UUID": null | ||
}, | ||
"path": ["time_field"], | ||
"repetitionType": "REQUIRED", | ||
"encoding": "PLAIN", | ||
"compression": "UNCOMPRESSED", | ||
"rLevelMax": 0, | ||
"dLevelMax": 0 | ||
} | ||
}, | ||
"fieldList": [ | ||
{ | ||
"name": "time_field", | ||
"primitiveType": "INT32", | ||
"originalType": "TIME_MILLIS", | ||
"logicalType": { | ||
"STRING": null, | ||
"MAP": null, | ||
"LIST": null, | ||
"ENUM": null, | ||
"DECIMAL": null, | ||
"DATE": null, | ||
"TIME": { | ||
"isAdjustedToUTC": false, | ||
"unit": { | ||
"MILLIS": {}, | ||
"MICROS": null, | ||
"NANOS": null | ||
} | ||
}, | ||
"TIMESTAMP": null, | ||
"INTEGER": null, | ||
"UNKNOWN": null, | ||
"JSON": null, | ||
"BSON": null, | ||
"UUID": null | ||
}, | ||
"path": ["time_field"], | ||
"repetitionType": "REQUIRED", | ||
"encoding": "PLAIN", | ||
"compression": "UNCOMPRESSED", | ||
"rLevelMax": 0, | ||
"dLevelMax": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$id": "https://example.com/time-nanos.schema.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "A schema to test the TIME logical type in Parquet with NANOS unit", | ||
"type": "object", | ||
"properties": { | ||
"time_field": { | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"type": "number", | ||
"description": "Time value in NANOS" | ||
}, | ||
"unit": { | ||
"type": "string", | ||
"enum": ["NANOS"], | ||
"description": "The unit is fixed to NANOS" | ||
}, | ||
"isAdjustedToUTC": { | ||
"type": "boolean", | ||
"description": "Whether the time is adjusted to UTC" | ||
} | ||
}, | ||
"required": ["value", "isAdjustedToUTC"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["time_field"] | ||
} |
Oops, something went wrong.