I am trying to create a simple streaming query ( like SELECT STREAM * FROM
ORDERS WHERE units > 10). I have created a stream using a socket that saves
the orders in an sOrders.csv file and I have changed the
model-stream-table.json like this:
{
version: '1.0',
defaultSchema: 'CUSTOM_TABLE',
schemas: [
{
name: 'CUSTOM_TABLE',
tables: [
{
name: 'ORDERS',
type: 'custom',
factory: 'org.apache.calcite.adapter.csv.CsvStreamTableFactory',
stream: {
stream: true
},
operand: {
file: '/home/hduser/Desktop/sOrders.csv',
flavor: "scannable"
}
}
]
}
, because when I had defaultSchema: 'STREAM' it showed: Error while
executing SQL "SELECT STREAM * FROM orders": From line 1, column 22 to line
1, column 27: Table 'ORDERS' not found (state=,code=0).
Everything is good, until I try to project or filter a column when it
shows: Error while executing SQL "SELECT STREAM productId FROM orders":
>From line 1, column 15 to line 1, column 23: Column 'PRODUCTID' not found
in any table (state=,code=0). When I type !columns I get: CUSTOM_TABLE |
ORDERS | productId | 4 | JavaType(class...
To solve my problem, should I write from the
start CsvStreamFilterableTable.java etc. or are these operations already
implemented?
Thank you in advance,
George