calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Γιώργος Θεοδωράκης <giwrgosrth...@gmail.com>
Subject Simple Streaming Senario
Date Sat, 03 Sep 2016 12:39:20 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message