There's no table in INFORMATION_SCHEMA.TABLES after CTAS

I have created a table named mytable use ctas.

create table $scratch.mytable as select * from xx.source

However I can’t get the meta of table mytable from INFORMATION_SCHEMA.

select * from INFORMATION_SCHEMA."TABLES" where table_name='mytable'

But it works after running select * from $scratch.mytable;.

@koolay, for your $scratch tables you Dremio is automatically formatting files into physical datasets when you issue a query against them. Once they are formatted, they are added to the catalog and visible in INFORMATION_SCHEMA. Before that, they are just files in the distributed file system.

Thanks for your reply.

It’s not friendly that INFORMATION_SCHEMA.TABLES require a query after execute CTAS.

I agree ! Especilaly because parquet files has a format !
what would be great is to have a command to format non explicit format (csv, txt, …)

Hi all, sorry for the delay…
There is a SQL syntax for formating in input or output (download the code from dremio-oss and search for “TABLE(” or “STORE AS”.

Here is description of available options I found :

Best regards,