I have correctly used sqlline to run queries on a streaming table, but now I face problems trying to implement it programmatically with java. I have made an attempt, but haven't got it running yet ( http://stackoverflow.com/questions/39318653/create-a-streaming-example-with-calcite-using-csv ). Can somebody help me by giving a template or finding what's wrong with my code?
Thank you in advance, George 2016-09-03 18:14 GMT+03:00 Γιώργος Θεοδωράκης <giwrgosrth...@gmail.com>: > When I tried a query like SELECT STREAM ss.depts.deptno FROM ss.depts > WHERE ss.depts.deptno < 30; it gave me a correct answer on the SDEPTS.cvs > in sales folder with both my json and model-stream-table.json. I only had > to declare better where to find the tables and the columns, because with > only the name it wouldn't run. I still haven't fixed my sOrders.csv yet, > but I suppose it has to do with how I have created. > > 2016-09-03 15:39 GMT+03:00 Γιώργος Θεοδωράκης <giwrgosrth...@gmail.com>: > >> 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.cs >> v.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 >> >> >> >