adjust / parquet_fdw

Parquet foreign data wrapper for PostgreSQL
PostgreSQL License
352 stars 38 forks source link

Request: Option to specify function to use for importing foreign schema #16

Closed einhverfr closed 4 years ago

einhverfr commented 4 years ago

In general there may be different ways we need to be able to import a foreign schema. Someone might assume that all files are to be imported, but others might need to be able to rotate files atomically according to some logic. Having some interface for specifying this function would be really helpful.

Seth-PM commented 4 years ago

needed for AB 2.0, will be done after 15.https://github.com/adjust/parquet_fdw/issues/15

Seth-PM commented 4 years ago

to be done by @zilder

zilder commented 4 years ago

Hi @einhverfr,

I'm working on a solution. I decided to add a separate function import_parquet() for this tasks (it think IMPORT FOREIGN SCHEMA is not well suited for it). You can find its description in README.md in the import branch. It's still in early stage of development and wasn't tested. I'll add a way to specify extra foreign table options and also to provide a list of table attributes (columns) to import in case end-user would want customize their foreign table.

zilder commented 4 years ago

The feature is ready for testing. The description is in README.md (the import section). The code is in import branch.

alexeyklyukin commented 4 years ago

@zilder Would you like to make a PR from this at this point (and also, perhaps, merge the current master in)?

Not a proper review, but there were some compiler warnings about unused variables in the parquet_impl.cpp

On thing I had to add here on MacOS is

#ifndef _GNU_SOURCE
#include <libgen.h>
#endif

that contains basename. Also, basename won't work on Windows.

zilder commented 4 years ago

@alexeyklyukin I'm going to do some refactoring regarding the use of postgres and c++ exceptions together. Things are not good right now. I'll create a PR after I finish this.

zilder commented 4 years ago

Merged into master