Commit Graph

36 Commits (f404a8ac31360c380e0ebcf1f1481411cda02fc1)

Author SHA1 Message Date
Jason Wilder ebd6e55997 Fix regression parsing boolean True/False values 2015-07-13 11:29:02 -06:00
Jason Wilder 1641c25479 Fix panic parsing floats without decimal
Fixes #3289
2015-07-10 14:18:51 -06:00
Jason Wilder 6b8d3268e6 Fix code review comments 2015-07-07 11:41:12 -06:00
Jason Wilder 351bc03655 Don't panic if NaN or -/+Inf is used as a field value
These are not supported types but previously it would cause the
point.Fields() func to panic.  This prevents it from panicing
so the values can be ignored if needed.
2015-07-06 16:14:02 -06:00
Jason Wilder 4d511571c5 Serialized unknown types as strings
When creating a point manually, the field values are interface{}
which allows unsupported types to be passed in.  Previously, the
code would panic.  It will now default to string representation of
the value if it's not a known type.
2015-07-06 16:14:02 -06:00
Jason Wilder a3ab093996 Parse NaN as float
Fixes #3230
2015-07-06 16:14:01 -06:00
Jason Wilder 41ae8bdae7 Handle escaped commas in measurement name
Fixes #3183
2015-06-29 15:15:50 -06:00
Joseph Crail 5fccee3d16 Fix spelling errors in comments and strings. 2015-06-28 02:54:34 -04:00
Jason Wilder 1a5a8d1675 Fix typos in comments 2015-06-26 14:36:19 -06:00
Jason Wilder d33b8bcd6a Return parsing error when tag name is missing
Fixes #2678
2015-06-26 13:47:09 -06:00
Jason Wilder 5081481ca8 Return error when parsing fields with no name
Fixes #3061
2015-06-26 13:39:25 -06:00
Jason Wilder 17432598b1 Prevent out of range ints and floats from being parsed sucessfully
Field values that were out of range for the type would panic the database
when being inserted because the parser would allow them as valid points.
This change prevents those invalid values from being parsed and instead
returns an error.

An alternative fix considered was to handle the error and clamp the value
to the min/max value for the type.  This would treat numeric range errors
slightly differently than other type erros which might lead to confusion.

The simplest fix with the current parser would be to just convert each field
to the type at parse time.  Unfortunately, this adds extra memory allocations
and lowers throughput significantly.  Since out of range values are less common
than in-range values, some heuristics are used to determine when the more
expensive type parsing and range checking is performed.  Essentially, we only
do the slow path when we cannot determine that the value is in an acceptable
type range.

Fixes #3127
2015-06-25 14:49:42 -06:00
Jason Wilder 7873ccbb20 Merge pull request #3039 from neonstalwart/line-comments
allow comments in line protocol
2015-06-22 14:09:56 -06:00
Jason Wilder 2854108941 Fix string field value escaping
Commas and quotes could get escaped and parsed incorrectly if they
were both present in a string value.

Fixes #3013
2015-06-22 13:17:35 -06:00
Jason Wilder cb9a40df64 Fix invalid field value format not parsed correctly
A field value of just a numeric value would be accepted by the line
protocol parser but the value would be set as the field name and
the value would be nil.  Instead, return an error because all field
values need a field name.
2015-06-22 10:35:08 -06:00
Todd Persen b6252868cc Add support for marshaling `uint64` in client. 2015-06-18 15:33:37 -07:00
ben hockey d4a341a5ae allow comments in line protocol 2015-06-18 14:03:27 -05:00
Jason Wilder 36cde5f35e Fix large integers getting converted to floats during remote writes
Fixes #2960

Integers were were written back to line protocol using strconv.FormatFloat
incorrectly.  Large integers are written in scientific notation which
causes their type to change to a float when parsed back.
2015-06-12 11:20:37 -06:00
Jason Wilder 30068561ae Fix parsing negative floats
Fixes #2919
2015-06-12 08:39:17 -06:00
Jason Wilder c97dedfa3d Be more explicit about boolean value parsing
Supported boolean values are now t, T, true, TRUE, f, F, false, and
FALSE.  This is what the strconv.ParseBool function supports with
the exception of 1 and 0.  1 and 0 would be parsed as ints in the
line protocol.

Previously, any non-true value would be parsed as false.  e.g.
value=blah would parse to false.  This will now return an error as
parsing time.
2015-06-11 14:53:53 -06:00
Jason Wilder 6d115a7552 Return the line that failed to parse
Make it easier to find a bad line in a batch when writing points.
2015-06-11 13:59:30 -06:00
Jason Wilder 0d82acfde7 Prevent invalid numbers from being parsed via line protocol
Adds more tests for invalid numbers such as 0.1a, -2.-4, as well
test for supported formats for negative and positive integers/floats
as well as scientific notation.
2015-06-11 13:50:28 -06:00
Jason Wilder b497256dc7 Fix panic when no value is passed to a field
Fixes #2927
2015-06-11 11:25:25 -06:00
Jason Wilder 3e969166c9 Fix parsing commas in string field values
Fixes a panic on writes because the field value was not parse correctly.

panic: unsupported value type during encode fields: <nil>

goroutine 117 [running]:
github.com/influxdb/influxdb/tsdb.(*FieldCodec).EncodeFields(0xc2081c4020, 0xc2081dc180, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/jason/go/src/github.com/influxdb/influxdb/tsdb/shard.go:573 +0x8e3
2015-06-09 15:53:21 -06:00
Cory LaNou bafdb7f7cb explicitly parse time if needed 2015-06-04 12:15:18 -06:00
Cory LaNou 780fdedbd4 remove spew 2015-06-04 11:29:18 -06:00
Cory LaNou 47d605b69a make line protocol round or parse precision as expected 2015-06-04 11:22:53 -06:00
Jason Wilder 870a183576 Ensure comma,space and equals are escaped 2015-05-29 14:34:06 -06:00
Jason Wilder 4e7c8bdad2 Add ParsePointsWithPrecision to handle precision write argument 2015-05-29 11:18:40 -06:00
Jason Wilder e1322bb7d9 Add initial write_points http handler for text protocol 2015-05-29 11:18:40 -06:00
Jason Wilder 9a9bb736f7 Add text protocol parsing and serialzation for points
This changes the implementation of point to minimize the extra
processing needed to parse and marshal point data though the system.
2015-05-29 11:18:40 -06:00
Jason Wilder 21bfb150a1 Wire up new write path
This allows the new write path to be hooked up if you start the
server with `INFLUXDB_ALPHA1=1`.  When set, writes will go though
the coordinator and be stubbed out to write to a single local data
node with one shards.  The write will be logged and written to
disk .

The env var is used so that the current write path is not completely
broken which would break many of the tests that depend on writes.

Note that queries are not currently working w/ the this change.
2015-05-26 12:07:56 -06:00
Jason Wilder 1076153a00 Convert Point to interface
Should be possible to replace the implementation with a more
optimized version now.
2015-05-22 15:39:55 -06:00
Jason Wilder 528f47e093 Convert Point.Fields to Point.Fields() 2015-05-22 15:22:03 -06:00
Jason Wilder f8d599cda9 Convert Point.Tags to Point.Tags() 2015-05-22 15:12:34 -06:00
Jason Wilder 5dcab443dc Move data.Point to tsdb.Point 2015-05-22 15:00:51 -06:00