You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Support integer types other than BIGINT (#485)
TODO:
- [x] Docs, specifically updating the `Data Types` section of the
readme, and how to override the schema to force the target into a
certain integer type
- [x] Tests
| integer with minimum >= 32768 or maximum < 32768 | smallint |
245
+
| integer with minimum >= 2147483648 or maximum < 2147483648 | integer |
246
+
| UNSUPPORTED | bigserial |
247
+
| UNSUPPORTED | bit [ (n) ] |
248
+
| UNSUPPORTED | bit varying [ (n) ] |
249
+
| boolean | boolean |
250
+
| UNSUPPORTED | box |
249
251
| string with contentEncoding="base16" ([opt-in feature](#content-encoding-support)) | bytea |
250
-
| UNSUPPORTED | character [ (n) ] |
251
-
| UNSUPPORTED | character varying [ (n) ] |
252
-
| UNSUPPORTED | cidr |
253
-
| UNSUPPORTED | circle |
254
-
| string with format="date" | date |
255
-
| UNSUPPORTED | double precision |
256
-
| UNSUPPORTED | inet |
257
-
| UNSUPPORTED | integer |
258
-
| UNSUPPORTED | interval [ fields ] [ (p) ] |
259
-
| UNSUPPORTED | json |
260
-
| array; object | jsonb |
261
-
| UNSUPPORTED | line |
262
-
| UNSUPPORTED | lseg |
263
-
| UNSUPPORTED | macaddr |
264
-
| UNSUPPORTED | macaddr8 |
265
-
| UNSUPPORTED | money |
266
-
| number | numeric [ (p, s) ] |
267
-
| UNSUPPORTED | path |
268
-
| UNSUPPORTED | pg_lsn |
269
-
| UNSUPPORTED | pg_snapshot |
270
-
| UNSUPPORTED | point |
271
-
| UNSUPPORTED | polygon |
272
-
| UNSUPPORTED | real |
273
-
| UNSUPPORTED | smallint |
274
-
| UNSUPPORTED | smallserial |
275
-
| UNSUPPORTED | serial |
276
-
| string without format; untyped | text |
277
-
| string with format="time" | time [ (p) ] [ without time zone ] |
278
-
| UNSUPPORTED | time [ (p) ] with time zone |
279
-
| string with format="date-time" | timestamp [ (p) ] [ without time zone ] |
280
-
| UNSUPPORTED | timestamp [ (p) ] with time zone |
281
-
| UNSUPPORTED | tsquery |
282
-
| UNSUPPORTED | tsvector |
283
-
| UNSUPPORTED | txid_snapshot |
284
-
| string with format="uuid" | uuid |
285
-
| UNSUPPORTED | xml |
252
+
| UNSUPPORTED | character [ (n) ] |
253
+
| UNSUPPORTED | character varying [ (n) ] |
254
+
| UNSUPPORTED | cidr |
255
+
| UNSUPPORTED | circle |
256
+
| string with format="date" | date |
257
+
| UNSUPPORTED | double precision |
258
+
| UNSUPPORTED | inet |
259
+
| UNSUPPORTED | interval [ fields ] [ (p) ] |
260
+
| UNSUPPORTED | json |
261
+
| array; object | jsonb |
262
+
| UNSUPPORTED | line |
263
+
| UNSUPPORTED | lseg |
264
+
| UNSUPPORTED | macaddr |
265
+
| UNSUPPORTED | macaddr8 |
266
+
| UNSUPPORTED | money |
267
+
| number | numeric [ (p, s) ] |
268
+
| UNSUPPORTED | path |
269
+
| UNSUPPORTED | pg_lsn |
270
+
| UNSUPPORTED | pg_snapshot |
271
+
| UNSUPPORTED | point |
272
+
| UNSUPPORTED | polygon |
273
+
| UNSUPPORTED | real |
274
+
| UNSUPPORTED | smallserial |
275
+
| UNSUPPORTED | serial |
276
+
| string without format; untyped | text |
277
+
| string with format="time" | time [ (p) ] [ without time zone ] |
278
+
| UNSUPPORTED | time [ (p) ] with time zone |
279
+
| string with format="date-time" | timestamp [ (p) ] [ without time zone ] |
280
+
| UNSUPPORTED | timestamp [ (p) ] with time zone |
281
+
| UNSUPPORTED | tsquery |
282
+
| UNSUPPORTED | tsvector |
283
+
| UNSUPPORTED | txid_snapshot |
284
+
| string with format="uuid" | uuid |
285
+
| UNSUPPORTED | xml |
286
286
287
287
Note that while object types are mapped directly to jsonb, array types are mapped to a jsonb array.
288
288
@@ -298,9 +298,28 @@ If a column has multiple jsonschema types, the following order is using to order
298
298
- DECIMAL
299
299
- BIGINT
300
300
- INTEGER
301
+
- SMALLINT
301
302
- BOOLEAN
302
303
- NOTYPE
303
304
305
+
### Using the Singer catalog to narrow down the Postgres data types
306
+
307
+
You can use [Singer catalog's schema](https://github.com/singer-io/getting-started/blob/master/docs/DISCOVERY_MODE.md#schemas) to override the data types coming from the tap. The easiest way to do this is to use Meltano and its [`schema` setting](https://docs.meltano.com/concepts/plugins/#schema-extra) for the tap:
308
+
309
+
```yaml
310
+
# meltano.yml
311
+
plugins:
312
+
extractors:
313
+
- name: tap-my-tap
314
+
schema:
315
+
some_stream_id:
316
+
my_column:
317
+
type: integer
318
+
# This will be mapped to 'smallint'
319
+
minimum: 0
320
+
maximum: 1000
321
+
```
322
+
304
323
## Content Encoding Support
305
324
306
325
Json Schema supports the [`contentEncoding` keyword](https://datatracker.ietf.org/doc/html/rfc4648#section-8), which can be used to specify the encoding of input string types.
0 commit comments