Closed mechatroner closed 1 year ago
I'm using RBQL (through VSCode) to "explore" CSV data produced as output by other scripts, and AS
would help a lot with queries such as SELECT a1,AVG(a2) GROUP BY a1
-- right now the second column just appears as col2
. That's fine with just one column, but it gets annoying with many of them.
Done.
Now it is possible to rewrite the query like this: SELECT a2 as id,AVG(a4) AS average GROUP BY a2
.
AS in SQL: definition It would be very convenient for CSV and Parquet(if we start to support it).
Although
AS
wouldn't make sense for some of the output formats e.g. for json (if we start to support it at some point). It could be possible to treatAS
in json output as a way to create key-value dictionary pairs, but it is actually much easier to do through the native json syntax e.g. instead ofSELECT a['foo'] as 'bar'
writeSELECT {'foo': a['bar']}
, the later notation also provides much more flexibility. AlsoAS
will not work well with native 2D-arrays as the output format.