@Test public void testDOSLineEnds() throws Exception { assertNoLeak(textLoader -> { final String expected = "f0\tf1\tf2\tf3\tf4\tf5\tf6\n" + "123\tabc\t2015-01-20T21:00:00.000Z\t3.1415\ttrue\tLorem ipsum dolor sit amet.\t122\n" + "124\tabc\t2015-01-20T21:00:00.000Z\t7.3420000000000005\tfalse\tLorem ipsum \n" + "\n" + "dolor \"sit\" amet.\t546756\n" + "125\tabc\t2015-01-20T21:00:00.000Z\t9.334\tfalse\tLorem ipsum \"dolor\" sit amet.\t23\n" + "126\tabc\t2015-01-20T21:00:00.000Z\t1.345\ttrue\tLorem, ipsum, dolor sit amet.\t434\n" + "127\tabc\t2015-01-20T21:00:00.000Z\t1.5332100000000002\ttrue\tLorem ipsum dolor sit amet.\t112\n" + "128\tabc\t2015-01-20T21:00:00.000Z\t2.456\ttrue\tLorem ipsum dolor sit amet.\t122\n"; String csv = "123,abc,2015-01-20T21:00:00.000Z,3.1415,TRUE,Lorem ipsum dolor sit amet.,122\r\n" + "124,abc,2015-01-20T21:00:00.000Z,7.342,FALSE,\"Lorem ipsum \n" + "\n" + "dolor \"\"sit\"\" amet.\",546756\r\n" + "125,abc,2015-01-20T21:00:00.000Z,9.334,,\"Lorem ipsum \"\"dolor\"\" sit amet.\",23\r\n" + "126,abc,2015-01-20T21:00:00.000Z,1.345,TRUE,\"Lorem, ipsum, dolor sit amet.\",434\r\n" + "126,abc,2015-01-20T21:00:00.000Z,1.345,TRUE,\"Lorem, ipsum, dolor sit amet.\",434,asdfasdf,asdfasdf,asdfasd\r\n" + "127,abc,2015-01-20T21:00:00.000Z,1.53321,TRUE,Lorem ipsum dolor sit amet.,112\r\n" + "128,abc,2015-01-20T21:00:00.000Z,2.456,TRUE,Lorem ipsum dolor sit amet.,122\r\n"; configureLoaderDefaults(textLoader, (byte) ','); textLoader.setForceHeaders(false); playText( textLoader, csv, 200, expected, "{\"columnCount\":7,\"columns\":[{\"index\":0,\"name\":\"f0\",\"type\":\"INT\"},{\"index\":1,\"name\":\"f1\",\"type\":\"STRING\"},{\"index\":2,\"name\":\"f2\",\"type\":\"DATE\"},{\"index\":3,\"name\":\"f3\",\"type\":\"DOUBLE\"},{\"index\":4,\"name\":\"f4\",\"type\":\"BOOLEAN\"},{\"index\":5,\"name\":\"f5\",\"type\":\"STRING\"},{\"index\":6,\"name\":\"f6\",\"type\":\"INT\"}],\"timestampIndex\":-1}", 6, 6 ); }); }
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; }