data fixes, partial custom indicator support
This commit is contained in:
@@ -80,9 +80,8 @@ public class SchemaInitializer {
|
||||
*/
|
||||
// Bump this when the schema changes. Tables with a different (or missing) version
|
||||
// will be dropped and recreated. Increment by 1 for each incompatible change.
|
||||
// v2: open/high/low/close changed from required to optional to support null gap bars
|
||||
// v3: timestamps changed from microseconds to nanoseconds; ticker format changed to BTC/USDT.BINANCE
|
||||
private static final String OHLC_SCHEMA_VERSION = "3";
|
||||
// v1: open/high/low/close required; ingestor forward-fills interior gaps with previous close
|
||||
private static final String OHLC_SCHEMA_VERSION = "1";
|
||||
private static final String SCHEMA_VERSION_PROP = "app.schema.version";
|
||||
|
||||
private void initializeOhlcTable() {
|
||||
@@ -121,7 +120,7 @@ public class SchemaInitializer {
|
||||
LOG.info("Creating OHLC table: {}", tableId);
|
||||
|
||||
// Define the OHLC schema.
|
||||
// timestamp is stored as BIGINT (microseconds since epoch), not a TIMESTAMP type,
|
||||
// timestamp is stored as BIGINT (nanoseconds since epoch), not a TIMESTAMP type,
|
||||
// so that GenericRowData.setField() accepts a plain Long value.
|
||||
Schema schema = new Schema(
|
||||
// Primary key fields
|
||||
@@ -129,11 +128,11 @@ public class SchemaInitializer {
|
||||
required(2, "period_seconds", Types.IntegerType.get(), "OHLC period in seconds"),
|
||||
required(3, "timestamp", Types.LongType.get(), "Candle timestamp in nanoseconds since epoch"),
|
||||
|
||||
// OHLC price data — optional to support gap bars (null = no trades that period)
|
||||
optional(4, "open", Types.LongType.get(), "Opening price"),
|
||||
optional(5, "high", Types.LongType.get(), "Highest price"),
|
||||
optional(6, "low", Types.LongType.get(), "Lowest price"),
|
||||
optional(7, "close", Types.LongType.get(), "Closing price"),
|
||||
// OHLC price data — required; ingestor forward-fills interior gaps with previous close
|
||||
required(4, "open", Types.LongType.get(), "Opening price (forward-filled for interior market gaps)"),
|
||||
required(5, "high", Types.LongType.get(), "Highest price"),
|
||||
required(6, "low", Types.LongType.get(), "Lowest price"),
|
||||
required(7, "close", Types.LongType.get(), "Closing price"),
|
||||
|
||||
// Volume data
|
||||
optional(8, "volume", Types.LongType.get(), "Total volume"),
|
||||
|
||||
Reference in New Issue
Block a user