uwescience / myria-web

Web frontend for Myria
https://demo.myria.cs.washington.edu
Other
11 stars 14 forks source link

splitting strings? #221

Closed sophieclayton closed 9 years ago

sophieclayton commented 9 years ago

is there a way to split strings?

the data looks like this: "2011_125" basically year_day

i want to strip the day from the year_day variable.

halp!

dhalperi commented 9 years ago

In your case, you can use substr(day, 5, len(day)) to get the characters from the 5th to the end.

We need something slicker in the general case.

sophieclayton commented 9 years ago

just tried this query:

good_opp_vct = scan(armbrustlab:seaflow:good_opp_vct_v4);

day = select Cruise, File_Id, substr(Day, 5, len(Day)) as yearday
        from good_opp_vct;

store(day, armbrustlab:seaflow:yearday_opp_vct);

and got this error: Error 400 (Bad Request): Error 400 (Bad Request): The second argument of substr has to be INT.

Since when is 5 not an integer?!...

dhalperi commented 9 years ago

wtf? I will look into this.