Open chapmanjacobd opened 1 year ago
also, what's going on with len()
?
octosql "SELECT * FROM docs.function_signatures"
...
| 'len' | [] | 'NULL' | true | false |
| 'len' | [] | 'NULL' | true | false |
| 'len' | [] | 'NULL' | true | false |
| 'len' | ['String'] | 'Int' | true | true |
...
octosql "SELECT len((0,1,2,3))"
+-------+
| col_0 |
+-------+
| 4 |
+-------+
seems to work fine...
octosql -v
octosql version dev
also, you might also want to store/print the git commit during compile time or something, for example:
'octosql version dev' + git describe --match=NeVeRmAtCh --always --abbrev=8 --dirty && git status --short
Hey!
So, multiple things you mentioned:
relaxed flag
The use case makes sense, I'll think about it.
No way to cast booleans to int
Good point, happy to add this.
what's going on with len()
When the simple_signature
is false, then the arg types / return types have no meaning. But it's a good point that this way it's completely unreadable right now what's supported and what isn't. I'll see if I can add "synthetic" signatures there.
len works with strings, lists, tuples, and objects right now.
No way to cast booleans to int
This is now added in https://github.com/cube2222/octosql/commit/cc43f257bfe318a5f93ca336728c13443aba6c7f and released in 0.11.1.
I really like how fast
octosql
is and it seems like a great tool to bring unstructured data into a strict hierarchical, columnar format.Unfortunately, wrangling unstructured data usually requires some flexibility and interpretation. I have two main issues so far:
1) Selecting variables which are in some files but not others:
⭐ It would be really nice to have a
--relaxed
flag where unknown variables are silently replaced withnull
⭐Ideally, that would:
octosql --relaxed
turn into "SELECT null, valid_column FROM stdin.json"2) No way to cast booleans to int?
For example, in sqlite: