-
Notifications
You must be signed in to change notification settings - Fork 0
DataChunk* should handle nil dates coming in from Cascalog #152
Comments
Yeah my bad. The precondition on date is WRONG. Fixing now with a tug request. |
Is it? On Fri, Jul 20, 2012, at 09:29 AM, Aaron Steele wrote:
|
Yeah but date is optional, which means you'll get an empty sequence which isn't nil. |
The fields coming in from Cascalog should be On Fri, Jul 20, 2012, at 09:32 AM, Aaron Steele wrote:
|
Yeah I'll shoot a pull in a mo. |
So now you're query works if you add the (??- (let [src [["ndvi" (thrift/ModisPixelLocation* "500" 28 8 0 0) 1 "16" nil]]]
(<- [?dc]
(src ?name ?loc ?val ?t-res !date)
(thrift/DataChunk* ?name ?loc ?val ?t-res :date !date :> ?dc)))) |
Does this require changing other queries that use the date field? On Jul 20, 2012, at 10:10 AM, Aaron Steele [email protected] wrote:
|
Ha, whoops. Yeah, all queries that use |
Ok, please run the tests for all of those namespaces too so that we are sure this isn't breaking something. Is there an easier way that avoids breaking existing queries, or is this a better way to handle optional args? On Jul 20, 2012, at 10:30 AM, Aaron Steele [email protected] wrote:
|
I think making optional args explicit via keywords is the way to go here. I mean, yeah, it's an API breaking change that requires some fixing on the caller side, but it's worth it IMO. Open to ideas though! |
Fixed in #154 |
What does On Fri, Jul 20, 2012 at 9:18 AM, Robin Kraft <
Sam Ritchie, Twitter Inc (Too brief? Here's why! http://emailcharter.org) |
Throws this:
On Sat, Jul 21, 2012, at 02:52 PM, Sam Ritchie wrote:
|
Nope. API now requires :date keyword so Sam's example won't make it to that
|
@sritchie I'm at a REPL now. (DataChunk* "ndvi" (ModisPixelLocation* "500" 28 8 0 0) 1 "16" nil)
;; No value supplied for key: null
;; [Thrown class java.lang.IllegalArgumentException] With the new API, we're required to pass in a (DataChunk* "ndvi" (ModisPixelLocation* "500" 28 8 0 0) 1 "16" :date nil)
forma.thrift> (DataChunk* "ndvi" (ModisPixelLocation* "500" 28 8 0 0) 1 "16" :date nil)
#<DataChunk DataChunk(dataset:ndvi, locationProperty:LocationProperty(property:<LocationPropertyValue pixelLocation:ModisPixelLocation(resolution:500, tileH:28, tileV:8, sample:0, line:0)>), chunkValue:<DataValue longVal:1>, temporalRes:16)> All good? |
Currently, as seen in issue #71, the
!date
field cannot be nullable if we're doing thrift packing within a query. Yet the precondition seems to handle dates correctly. The workaround we're using in #141 simply removes the!date
field completely from the query, but we should get a better handle on why we can't have a nullable date field.This query illustrates the problem:
The text was updated successfully, but these errors were encountered: