You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Ted Dunning <te...@gmail.com> on 2013/08/01 01:55:58 UTC
Re: [jira] [Commented] (DRILL-159) 1.sql
On Wed, Jul 31, 2013 at 12:45 PM, Julian Hyde <ju...@gmail.com> wrote:
> > Is there a good dynamic way to attach tables to files?
>
>
> Do you mean, how can I access a file as a table if I haven't previously
> defined columns for it? You need to define an Optiq schema so that you can
> access the raw table (the one with the _MAP column). Then instead of
> defining a view on that table, you can just execute a SQL statement.
>
I mean "where is the file name?"
I didn't see anything in the schema that looked like a file name.
Re: [jira] [Commented] (DRILL-159) 1.sql
Posted by Ted Dunning <te...@gmail.com>.
Gotcha.
Thanks.
On Wed, Jul 31, 2013 at 5:22 PM, Julian Hyde <ju...@gmail.com> wrote:
> On Jul 31, 2013, at 4:55 PM, Ted Dunning <te...@gmail.com> wrote:
>
> > I mean "where is the file name?"
> >
> > I didn't see anything in the schema that looked like a file name.
>
> File name is one of the operands to DrillTable.Factory. My example wrongly
> omitted it, but Sree's example has a "path" operand:
>
> private static final String MODEL_LINEITEM =
> "{\n"
> + " version: '1.0',\n"
> + " schemas: [\n"
> + " {\n"
> + " name: 'LINEITEM',\n"
> + " tables: [\n"
> + " {\n"
> + " name: 'LINEITEM',\n"
> + " type: 'custom',\n"
> + " factory: '" + DrillTable.Factory.class.getName() +
> "',\n"
> + " operand: {\n"
> + " path: '/lineitem.tbl.1.json'\n"
> + " }\n"
> + " }\n"
> + " ]\n"
> + " }\n"
> + " ]\n"
> + "}";
>
> Julian
>
>
Re: [jira] [Commented] (DRILL-159) 1.sql
Posted by Julian Hyde <ju...@gmail.com>.
On Jul 31, 2013, at 4:55 PM, Ted Dunning <te...@gmail.com> wrote:
> I mean "where is the file name?"
>
> I didn't see anything in the schema that looked like a file name.
File name is one of the operands to DrillTable.Factory. My example wrongly omitted it, but Sree's example has a "path" operand:
private static final String MODEL_LINEITEM =
"{\n"
+ " version: '1.0',\n"
+ " schemas: [\n"
+ " {\n"
+ " name: 'LINEITEM',\n"
+ " tables: [\n"
+ " {\n"
+ " name: 'LINEITEM',\n"
+ " type: 'custom',\n"
+ " factory: '" + DrillTable.Factory.class.getName() + "',\n"
+ " operand: {\n"
+ " path: '/lineitem.tbl.1.json'\n"
+ " }\n"
+ " }\n"
+ " ]\n"
+ " }\n"
+ " ]\n"
+ "}";
Julian