/** * Returns a Schema for a Bits but with all other default Schema settings. * * @param length maximum the number of bits in the set * @return the schema * @see #builder(int) */ public static Schema schema(int length) { return builder(length).build(); }
protected List<SchemaAndValueField> schemaAndValuesForBinTypes() { return Arrays.asList(new SchemaAndValueField("ba", Schema.OPTIONAL_BYTES_SCHEMA, ByteBuffer.wrap(new byte[]{ 1, 2, 3})), new SchemaAndValueField("bol", Schema.OPTIONAL_BOOLEAN_SCHEMA, false), new SchemaAndValueField("bs", Bits.builder(2).optional().build(), new byte[] { 3, 0 }), // bitsets get converted from two's complement new SchemaAndValueField("bv", Bits.builder(2).optional().build(), new byte[] { 0, 0 })); }
return Bits.builder(column.length());
case PgOid.BIT_ARRAY: case PgOid.VARBIT: return column.length() > 1 ? Bits.builder(column.length()) : SchemaBuilder.bool(); case PgOid.INTERVAL: return MicroDuration.builder();
assertTableSchema("public.cash_table", "csh", Decimal.builder(0).optional().build()); assertTableSchema("public.bitbin_table", "ba, bol, bs, bv", Schema.OPTIONAL_BYTES_SCHEMA, Schema.OPTIONAL_BOOLEAN_SCHEMA, Bits.builder(2).optional().build(), Bits.builder(2).optional().build()); assertTableSchema("public.time_table", "ts, tz, date, ti, ttz, it", MicroTimestamp.builder().optional().build(), ZonedTimestamp.builder().optional().build(),
/** * Returns a Schema for a Bits but with all other default Schema settings. * * @param length maximum the number of bits in the set * @return the schema * @see #builder(int) */ public static Schema schema(int length) { return builder(length).build(); }
protected List<SchemaAndValueField> schemaAndValuesForBinTypes() { return Arrays.asList(new SchemaAndValueField("ba", Schema.OPTIONAL_BYTES_SCHEMA, ByteBuffer.wrap(new byte[]{ 1, 2, 3})), new SchemaAndValueField("bol", Schema.OPTIONAL_BOOLEAN_SCHEMA, false), new SchemaAndValueField("bs", Bits.builder(2).optional().build(), new byte[] { 3, 0 }), // bitsets get converted from two's complement new SchemaAndValueField("bv", Bits.builder(2).optional().build(), new byte[] { 0, 0 })); }
return Bits.builder(column.length());
case PgOid.BIT_ARRAY: case PgOid.VARBIT: return column.length() > 1 ? Bits.builder(column.length()) : SchemaBuilder.bool(); case PgOid.INTERVAL: return MicroDuration.builder();
assertTableSchema("public.cash_table", "csh", Decimal.builder(0).optional().build()); assertTableSchema("public.bitbin_table", "ba, bol, bs, bv", Schema.OPTIONAL_BYTES_SCHEMA, Schema.OPTIONAL_BOOLEAN_SCHEMA, Bits.builder(2).optional().build(), Bits.builder(2).optional().build()); assertTableSchema("public.time_table", "ts, tz, date, ti, ttz, it", MicroTimestamp.builder().optional().build(), ZonedTimestamp.builder().optional().build(),