-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(cmd/influx/write): add new processing options and enhancements #18779
Conversation
Thanks for addressing my concern. It looks much better. |
pkg/csv2lp/csv_annotations.go
Outdated
columnLabel := placeholder[2 : len(placeholder)-1] // ${columnLabel} | ||
if columnLabel == "$" { | ||
return nil // ${$} is a way to print $ |
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.
stray comments?
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.
👍 there is no need to do so
pkg/csv2lp/data_conversion.go
Outdated
func normalizeNumberString(value string, format string, removeFraction bool) string { | ||
if len(format) == 0 { | ||
func normalizeNumberString(value string, format string, removeFraction bool) (normalized string, truncated bool) { | ||
if format == "" { |
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.
if format == "" { | |
if len(format) == 0 { |
the former method is technically faster
@@ -110,20 +112,20 @@ func normalizeNumberString(value string, format string, removeFraction bool) str | |||
} | |||
if c == fractionRune { | |||
if removeFraction { | |||
break ForAllCharacters | |||
return retVal.String(), true |
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.
i assume this new behavior is intended (not looping through values again)?
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.
it is intended, the function was changed to return also a truncated indicator, which is true
only in this case
3867c87
to
78fe5c6
Compare
Closes #18744 : indicate a loss of precision when parsing long/unsignedLong data types
When parsing
long
orunsignedLong
value from a string value with fraction digits, the whole CSV row fails when in a strict mode, which is turned on using a column dataFormat that starts withstrict
, such aslong:strict
. A warning is printed when not in a strict mode, sayingline x: column y: '1.2' truncated to '1' to fit into long data type
. Package documentation explains strict parsing.Closes #18742 : add the ability to write rejected records to a specific file
There is a new --error-file option in
influx write
The file then contains rows than cannot be imported because of data quality issues, CSV comments are also written to let the user know of what was wrong, for example:
Closes #18741: add the ability to construct a timestamp from multiple columns
A new
#concat
annotation adds a new column that is concatenated from existing columns according to bash-like string interpolation literal with variables referencing existing column labels. For example:#concat,string,fullName,${firstName} ${lastName}