-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(http): fix issues with importing CSV over HTTP #3790
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
private void doSend(int timeout) { | ||
private void doSend() { | ||
// System.out.println("send()"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: debris
// .query("query", "cpu%20limit%20400000") | ||
.query("query", "cpu limit 2") | ||
// .query("query", "cpu") | ||
// query execution example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: debris
.query("timestamp", timestampColumnName) | ||
.query("partitionBy", partitionBy) | ||
.query("overwrite", "false") | ||
// .query("skipLev", "false") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: debris
@@ -401,29 +401,6 @@ public void testImportsCreateAsSelectAndDrop() throws Exception { | |||
}); | |||
} | |||
|
|||
@Test | |||
public void testImportsHeaderIsNotFullyReceivedIntoReceiveBuffer() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be a valid test case, why is it removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a valid test, we should (and are able) to parse csv input with buffer size set to 1 byte. The exception was artificial. The header parser uses its own buffer, which is large enough for the test.
After I removed artificial check this test stopped making sense
# Conflicts: # core/src/main/java/io/questdb/PropServerConfiguration.java # core/src/main/java/io/questdb/cairo/CairoEngine.java # core/src/main/java/io/questdb/cutlass/http/HttpConnectionContext.java # core/src/main/java/io/questdb/cutlass/http/HttpHeaderParser.java # core/src/main/java/io/questdb/cutlass/http/client/HttpClient.java # core/src/main/java/io/questdb/cutlass/http/client/HttpClientMain.java # core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java # core/src/main/java/io/questdb/cutlass/http/processors/PrometheusMetricsProcessor.java # core/src/main/java/io/questdb/cutlass/http/processors/TextImportProcessor.java # core/src/main/java/io/questdb/cutlass/line/tcp/LineTcpMeasurementScheduler.java # core/src/main/java/io/questdb/cutlass/text/CairoTextWriter.java # core/src/main/java/io/questdb/cutlass/text/SerialCsvFileImporter.java # core/src/main/java/io/questdb/cutlass/text/TextLoader.java # core/src/main/java/io/questdb/cutlass/text/types/DateAdapter.java # core/src/main/java/io/questdb/cutlass/text/types/DateUtf8Adapter.java # core/src/main/java/io/questdb/cutlass/text/types/TimestampAdapter.java # core/src/main/java/io/questdb/cutlass/text/types/TimestampUtf8Adapter.java # core/src/main/java/io/questdb/cutlass/text/types/TypeAdapter.java # core/src/main/java/io/questdb/cutlass/text/types/TypeManager.java # core/src/main/java/io/questdb/std/datetime/microtime/TimestampFormatCompiler.java # core/src/main/java/io/questdb/std/str/CharSink.java # core/src/main/java/module-info.java # core/src/test/java/io/questdb/test/PropServerConfigurationTest.java # core/src/test/java/io/questdb/test/cutlass/http/IODispatcherTest.java # core/src/test/java/io/questdb/test/cutlass/http/TestHttpClient.java # core/src/test/java/io/questdb/test/cutlass/text/TextLoaderTest.java
- removed schema vs target table validation - added target table column conflict check - added tests - removed 'insert_null' json field - added truncate import option
…X lines in csv file.
# Conflicts: # core/src/main/java/io/questdb/cutlass/http/HttpConstants.java # core/src/main/java/io/questdb/cutlass/http/client/HttpClient.java # core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java # core/src/main/java/io/questdb/cutlass/http/processors/TextImportProcessor.java # core/src/main/java/io/questdb/cutlass/text/CairoTextWriter.java # core/src/main/java/io/questdb/cutlass/text/TextLoader.java # core/src/main/java/io/questdb/cutlass/text/TextStructureAnalyser.java # core/src/main/java/io/questdb/cutlass/text/types/DateUtf8Adapter.java # core/src/main/java/io/questdb/cutlass/text/types/TimestampUtf8Adapter.java # core/src/main/java/io/questdb/cutlass/text/types/TypeAdapter.java # core/src/main/java/io/questdb/cutlass/text/types/TypeManager.java # core/src/main/java/io/questdb/std/Chars.java # core/src/test/java/io/questdb/test/cairo/Overrides.java # core/src/test/java/io/questdb/test/cutlass/http/IODispatcherTest.java # core/src/test/java/io/questdb/test/cutlass/http/TestHttpClient.java
[PR Coverage check]😍 pass : 1657 / 1899 (87.26%) file detail
|
httpclient
wal
URL param to force non-WAL table to be created even if both timestamp and partition method are provided.true
,TRUE
,tRue
etc all valid boolean values.New changes:
truncate
parameter to /imp endpoint to allow truncating target table prior to import (if it exists)skipLineExtraValues
parameter to /imp as alias to skipLevskipLines
parameter to /imp endpoint to allow skipping first N lines of csv file (e.g. if these lines are mangled)file_column_ignore
field to schemaV2 column mapping to allow user to ignore unnecessary columns. Such columns are excluded from type detection. Note:table_column_insert_null
wasn't added and validation doesn't fail if some column is not mapped because it'd be cumbersome and annoying to users. Any missing target table columns will be set to null/type's default value.Sample text output (for a messed-up mapping):
More at https://github.com/questdb/rfc/discussions/110