Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ekX1w-0002Nw-7y for pgsql-general@arkaria.postgresql.org; Sat, 10 Feb 2018 15:25:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekX1v-0000d4-26 for pgsql-general@arkaria.postgresql.org; Sat, 10 Feb 2018 15:25:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekX1u-0000ct-8Y for pgsql-general@lists.postgresql.org; Sat, 10 Feb 2018 15:25:30 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ekX1m-0005n8-8E for pgsql-general@postgresql.org; Sat, 10 Feb 2018 15:25:29 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7ABF420B4D; Sat, 10 Feb 2018 10:25:20 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Sat, 10 Feb 2018 10:25:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=TazzxNpA7ECNq17EYy0sPlwaWHLgl gsX/r5j39Hx3Fg=; b=nr8jtYwRdI/HKVR85ggxas3GOCzogwLSczTdj0ehVU9RO shgd0R56PmjLYwbo0vrqLTjTrK6mbalBspfyyZCtNo3dhvZ0qoaoWMzKfqbeHexR IPpa4zbpmLBtISymxRu8xtWLCsmdBMb9HTNrwY2uXCIgFlf9iQJXjMeyKi//2jxN N7bvbEc1P6HSLWlz0Sx5ZpXaO4tgBkLQfjWiE/KkpKES4h8/wkQlHChtEL+13pqR DkzTtI7EvsvtFeSXkx6j2pqS0FGmaWbdnkdt08UeXX7n9aOVrJjn/FGZYdNBxU8g jR1auSoSN3wlBnF7NS9PXNyg3CgD2ADH0W+cvL8Iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=TazzxN pA7ECNq17EYy0sPlwaWHLglgsX/r5j39Hx3Fg=; b=A0yzJgeQGrndJ56m5jsnup MhMG1RFbqa7bEuMMvTHqglk1cjB+Io0YAOrY0TqxKFGHCvigr0/kztPsajTT0Mh3 8cdyCCtrT418xX+5U88aHKAhxWIJ5k/Ne4/dU1z1KmQOkTcc7wE0Wiw3Dwgjx4aJ x3bs+jBqRF9gN5x2SfbvOl62OB1/yucHH05wh3SCA+N6yRtc+fyvmUzSPYEf/Zle mjJPsEnByVlMerLMr1hEaddoGrtZF9nU5ewQn7tOm+97+fohzEJwhSkK9L5llOqR zNeBRgbF3vQGX7s/oCfFJsr0G8+V9WNoBhBeo4WkztZVEyhlNzZb/APmCiXdyEHA == X-ME-Sender: Received: from ranger.suse (71-212-36-41.tukw.qwest.net [71.212.36.41]) by mail.messagingengine.com (Postfix) with ESMTPA id B46AE7E4FA; Sat, 10 Feb 2018 10:25:19 -0500 (EST) Subject: Re: New Copy Formats - avro/orc/parquet To: Nicolas Paris , pgsql-general@postgresql.org References: <20180210151304.fonjztsynewldfba@gmail.com> From: Adrian Klaver Message-ID: <78a8f0bd-4b6f-b791-b6ce-80b19e2b6d1b@aklaver.com> Date: Sat, 10 Feb 2018 07:25:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180210151304.fonjztsynewldfba@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 02/10/2018 07:13 AM, Nicolas Paris wrote: > Hello > > I d'found useful to be able to import/export from postgres to those modern data > formats: > - avro (c writer=https://avro.apache.org/docs/1.8.2/api/c/index.html) > - parquet (c++ writer=https://github.com/apache/parquet-cpp) > - orc (all writers=https://github.com/apache/orc) > > Something like : > COPY table TO STDOUT ORC; > > Would be lovely. > > This would greatly enhance how postgres integrates in big-data ecosystem. > > Any thought ? https://www.postgresql.org/docs/10/static/sql-copy.html "PROGRAM A command to execute. In COPY FROM, the input is read from standard output of the command, and in COPY TO, the output is written to the standard input of the command. Note that the command is invoked by the shell, so if you need to pass any arguments to shell command that come from an untrusted source, you must be careful to strip or escape any special characters that might have a special meaning for the shell. For security reasons, it is best to use a fixed command string, or at least avoid passing any user input in it. " > > Thanks > -- Adrian Klaver adrian.klaver@aklaver.com