pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to import Apache parquet files?
5+ messages / 4 participants
[nested] [flat]
* How to import Apache parquet files?
@ 2019-11-05 14:56 Softwarelimits <softwarelimits@gmail.com>
2019-11-05 15:09 ` Re: How to import Apache parquet files? Imre Samu <pella.samu@gmail.com>
2019-11-11 00:16 ` Re: How to import Apache parquet files? Nicolas Paris <nicolas.paris@riseup.net>
0 siblings, 2 replies; 5+ messages in thread
From: Softwarelimits @ 2019-11-05 14:56 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Hi, I need to come and ask here, I did not find enough information so I
hope I am just having a bad day or somebody is censoring my search results
for fun... :)
I would like to import (lots of) Apache parquet files to a PostgreSQL 11
cluster - yes, I believe it should be done with the Python pyarrow module,
but before digging into the possible traps I would like to ask here if
there is some common, well understood and documented tool that may be
helpful with that process?
It seems that the COPY command can import binary data, but I am not able to
allocate enough resources to understand how to implement a parquet file
import with that.
I really would like follow a person with much more knowledge than me about
either PostgreSQL or Apache parquet format instead of inventing a bad
wheel.
Any hints very welcome,
thank you very much for your attention!
John
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to import Apache parquet files?
2019-11-05 14:56 How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
@ 2019-11-05 15:09 ` Imre Samu <pella.samu@gmail.com>
2019-11-05 15:21 ` Re: How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Imre Samu @ 2019-11-05 15:09 UTC (permalink / raw)
To: Softwarelimits <softwarelimits@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
>I would like to import (lots of) Apache parquet files to a PostgreSQL 11
cluster
imho: You have to check and test the Parquet FDW ( Parquet File Wrapper )
- https://github.com/adjust/parquet_fdw
Imre
Softwarelimits <softwarelimits@gmail.com> ezt írta (időpont: 2019. nov. 5.,
K, 15:57):
> Hi, I need to come and ask here, I did not find enough information so I
> hope I am just having a bad day or somebody is censoring my search results
> for fun... :)
>
> I would like to import (lots of) Apache parquet files to a PostgreSQL 11
> cluster - yes, I believe it should be done with the Python pyarrow module,
> but before digging into the possible traps I would like to ask here if
> there is some common, well understood and documented tool that may be
> helpful with that process?
>
> It seems that the COPY command can import binary data, but I am not able
> to allocate enough resources to understand how to implement a parquet file
> import with that.
>
> I really would like follow a person with much more knowledge than me about
> either PostgreSQL or Apache parquet format instead of inventing a bad
> wheel.
>
> Any hints very welcome,
> thank you very much for your attention!
> John
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to import Apache parquet files?
2019-11-05 14:56 How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
2019-11-05 15:09 ` Re: How to import Apache parquet files? Imre Samu <pella.samu@gmail.com>
@ 2019-11-05 15:21 ` Softwarelimits <softwarelimits@gmail.com>
2019-11-05 16:05 ` Re: How to import Apache parquet files? Tomas Vondra <tomas.vondra@2ndquadrant.com>
0 siblings, 1 reply; 5+ messages in thread
From: Softwarelimits @ 2019-11-05 15:21 UTC (permalink / raw)
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Hi Imre, thanks for the quick response - yes, I found that, but I was not
sure if it is already production ready - also I would like to use the data
with the timescale extension, that is why I need a full import.
Have nice day!
On Tue, Nov 5, 2019 at 4:09 PM Imre Samu <pella.samu@gmail.com> wrote:
> >I would like to import (lots of) Apache parquet files to a PostgreSQL 11
> cluster
>
> imho: You have to check and test the Parquet FDW ( Parquet File Wrapper )
> - https://github.com/adjust/parquet_fdw
>
> Imre
>
>
>
>
> Softwarelimits <softwarelimits@gmail.com> ezt írta (időpont: 2019. nov.
> 5., K, 15:57):
>
>> Hi, I need to come and ask here, I did not find enough information so I
>> hope I am just having a bad day or somebody is censoring my search results
>> for fun... :)
>>
>> I would like to import (lots of) Apache parquet files to a PostgreSQL 11
>> cluster - yes, I believe it should be done with the Python pyarrow module,
>> but before digging into the possible traps I would like to ask here if
>> there is some common, well understood and documented tool that may be
>> helpful with that process?
>>
>> It seems that the COPY command can import binary data, but I am not able
>> to allocate enough resources to understand how to implement a parquet file
>> import with that.
>>
>> I really would like follow a person with much more knowledge than me
>> about either PostgreSQL or Apache parquet format instead of inventing a bad
>> wheel.
>>
>> Any hints very welcome,
>> thank you very much for your attention!
>> John
>>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to import Apache parquet files?
2019-11-05 14:56 How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
2019-11-05 15:09 ` Re: How to import Apache parquet files? Imre Samu <pella.samu@gmail.com>
2019-11-05 15:21 ` Re: How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
@ 2019-11-05 16:05 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
0 siblings, 0 replies; 5+ messages in thread
From: Tomas Vondra @ 2019-11-05 16:05 UTC (permalink / raw)
To: Softwarelimits <softwarelimits@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
On Tue, Nov 05, 2019 at 04:21:45PM +0100, Softwarelimits wrote:
>Hi Imre, thanks for the quick response - yes, I found that, but I was not
>sure if it is already production ready - also I would like to use the data
>with the timescale extension, that is why I need a full import.
>
Well, we're not in the position to decide if parquet_fdw is production
ready, that's something you need to ask author of the extension (and
then also judge yourself).
That being said, I think FDW is probably the best way to do this. It's
explicitly designed to work with foreign data, so using it to access
parquet files seems somewhat natural.
The alternative is probably transforming the data into COPY format, and
then load it into Postgres using COPY (either as a file, or stdin).
Which of these options is the right one depends on your requirements.
FDW is more convenient, but row-based and probably significantly less
efficient than COPY. So if you have a lot of these parquet files, I'd
probably use the COPY. But maybe the ability to query the parquet files
directly (with FDW) is useful for you.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to import Apache parquet files?
2019-11-05 14:56 How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
@ 2019-11-11 00:16 ` Nicolas Paris <nicolas.paris@riseup.net>
1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Paris @ 2019-11-11 00:16 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
> I would like to import (lots of) Apache parquet files to a PostgreSQL 11
you might be intersted in spark-postgres library. Basically the library
allows you to bulk load parquet files in one spark command:
> spark
> .read.format("parquet")
> .load(parquetFilesPath) // read the parquet files
> .write.format("postgres")
> .option("host","yourHost")
> .option("partitions", 4) // 4 threads
> .option("table","theTable")
> .option("user","theUser")
> .option("database","thePgDatabase")
> .option("schema","thePgSchema")
> .loada // bulk load into postgres
more details at https://github.com/EDS-APHP/spark-etl/tree/master/spark-postgres
On Tue, Nov 05, 2019 at 03:56:26PM +0100, Softwarelimits wrote:
> Hi, I need to come and ask here, I did not find enough information so I hope I
> am just having a bad day or somebody is censoring my search results for fun...
> :)
>
> I would like to import (lots of) Apache parquet files to a PostgreSQL 11
> cluster - yes, I believe it should be done with the Python pyarrow module, but
> before digging into the possible traps I would like to ask here if there is
> some common, well understood and documented tool that may be helpful with that
> process?
>
> It seems that the COPY command can import binary data, but I am not able to
> allocate enough resources to understand how to implement a parquet file import
> with that.
>
> I really would like follow a person with much more knowledge than me about
> either PostgreSQL or Apache parquet format instead of inventing a bad wheel.
>
> Any hints very welcome,
> thank you very much for your attention!
> John
--
nicolas
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2019-11-11 00:16 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 14:56 How to import Apache parquet files? Softwarelimits <softwarelimits@gmail.com>
2019-11-05 15:09 ` Imre Samu <pella.samu@gmail.com>
2019-11-05 15:21 ` Softwarelimits <softwarelimits@gmail.com>
2019-11-05 16:05 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
2019-11-11 00:16 ` Nicolas Paris <nicolas.paris@riseup.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox