Re: [DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-26 Thread Rui Li
Hi everyone, According to the feedback, it seems adding `isTemporary` to factory context is the preferred way to fix the issue. I'll go ahead and make the change if no one objects. On Tue, Aug 25, 2020 at 5:36 PM Rui Li wrote: > Hi, > > Thanks everyone for your inputs. > > Temporary hive table

Re: [DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-25 Thread Rui Li
Hi, Thanks everyone for your inputs. Temporary hive table is not supported at the moment. If we want to support it, I agree with Jingsong that the life cycle of the temporary table should somehow be bound to the hive catalog. For example, hive catalog should be responsible to delete the table fol

Re: [DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-25 Thread Jingsong Li
Hi Jark, You raised a good point: Creating the Hive temporary table. AFAIK, Hive temporary tables should be stored in metastore, Hive metastore will maintain their life cycle. Correct me if I am wrong. So actually, if we want to support Hive temporary tables, we should finish one thing: - A tempo

Re: [DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-25 Thread Jark Wu
Hi, I'm wondering if we always fallback to using SPI for temporary tables, then how does the create Hive temporary table using Hive dialect work? IMO, adding an "isTemporary" to the factory context sounds reasonable to me, because the factory context should describe the full content of create tab

Re: [DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-25 Thread Jingsong Li
Hi Dawid, But the temporary table does not belong to Catalog, actually Catalog doesn't know the existence of the temporary table. Let the table factory of catalog to create source/sink sounds a little sudden. If we want to make temporary tables belong to Catalog, I think we need to involve catalo

Re: [DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-25 Thread Dawid Wysakowicz
Hi Rui, My take is that temporary tables should use the factory of the catalog they were registered with. What you are describing sounds very much like a limitation/bug in Hive catalog only. I'd be in favor of passing the *isTemporary* flag. Best, Dawid On 25/08/2020 09:37, Rui Li wrote: > Hi

[DISCUSS] Whether catalog table factory should be used for temporary tables

2020-08-25 Thread Rui Li
Hi Dev, Currently temporary generic tables cannot work with hive catalog [1]. When hive catalog is chosen as the current catalog, planner will use HiveTableFactory to create source/sink for the temporary table. HiveTableFactory cannot tell whether a table is temporary or not, and considers it as a