@Test public void testImportTimestamp() throws Exception { final TextConfiguration textConfiguration = new DefaultTextConfiguration() { @Override public int getTextAnalysisMaxLines() { return 3; } }; CairoConfiguration configuration = new DefaultCairoConfiguration(root) { @Override public TextConfiguration getTextConfiguration() { return textConfiguration; } }; try (CairoEngine engine = new CairoEngine(configuration)) { assertNoLeak( engine, textLoader -> { String expected = "StrSym\tts\n" + "CMP1\t2015-01-13T19:15:09.000000Z\n" + "CMP2\t2015-01-13T19:15:09.000234Z\n" + "CMP1\t2015-01-13T19:15:09.000455Z\n" + "CMP2\t2015-01-13T19:15:09.000754Z\n" + "CMP1\t2015-01-13T19:15:09.000903Z\n"; String csv = "StrSym,ts\n" + "CMP1,2015-01-13T19:15:09.000000Z\n" + "CMP2,2015-01-13T19:15:09.000234Z\n" + "CMP1,2015-01-13T19:15:09.000455Z\n" + "CMP2,2015-01-13T19:15:09.000754Z\n" + "CMP1,2015-01-13T19:15:09.000903Z\n"; configureLoaderDefaults(textLoader, (byte) ','); textLoader.setForceHeaders(false); playText( engine, textLoader, csv, 1024, expected, "{\"columnCount\":2,\"columns\":[{\"index\":0,\"name\":\"StrSym\",\"type\":\"STRING\"},{\"index\":1,\"name\":\"ts\",\"type\":\"TIMESTAMP\"}],\"timestampIndex\":-1}", 5, 5 ); }); } }
public void setForceHeaders(boolean forceHeaders) { this.forceHeaders = forceHeaders; }
TextLoader implements Closeable, Mutable { public void setForceHeaders(boolean forceHeaders) { this.forceHeaders = forceHeaders; } }
TextLoader implements Closeable, Mutable { public void setForceHeaders(boolean forceHeaders) { this.forceHeaders = forceHeaders; } TextLoader(CairoEngine engine); }
TextLoader implements Closeable, Mutable { public void setForceHeaders(boolean forceHeaders) { this.forceHeaders = forceHeaders; } TextLoader(CairoEngine engine); @Override void clear(); @Override void close(); void configureColumnDelimiter(byte columnDelimiter); void configureDestination(CharSequence tableName, boolean overwrite, boolean durable, int atomicity, int partitionBy, CharSequence timestampIndexCol); byte getColumnDelimiter(); LongList getColumnErrorCounts(); RecordMetadata getMetadata(); long getParsedLineCount(); long getErrorLineCount(); int getPartitionBy(); CharSequence getTableName(); long getWrittenLineCount(); boolean hasHeader(); boolean isForceHeaders(); void setForceHeaders(boolean forceHeaders); void setSkipRowsWithExtraValues(boolean skipRowsWithExtraValues); void parse(long lo, long hi, CairoSecurityContext cairoSecurityContext); void setState(int state); void wrapUp(); }
TextLoader implements Closeable, Mutable { public void setForceHeaders(boolean forceHeaders) { this.forceHeaders = forceHeaders; } TextLoader(CairoEngine engine); @Override void clear(); @Override void close(); void configureColumnDelimiter(byte columnDelimiter); void configureDestination(CharSequence tableName, boolean overwrite, boolean durable, int atomicity, int partitionBy, CharSequence timestampIndexCol); byte getColumnDelimiter(); LongList getColumnErrorCounts(); RecordMetadata getMetadata(); long getParsedLineCount(); long getErrorLineCount(); int getPartitionBy(); CharSequence getTableName(); long getWrittenLineCount(); boolean hasHeader(); boolean isForceHeaders(); void setForceHeaders(boolean forceHeaders); void setSkipRowsWithExtraValues(boolean skipRowsWithExtraValues); void parse(long lo, long hi, CairoSecurityContext cairoSecurityContext); void setState(int state); void wrapUp(); static final int LOAD_JSON_METADATA; static final int ANALYZE_STRUCTURE; static final int LOAD_DATA; }