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 1ekYqR-0000Rf-6w for pgsql-general@arkaria.postgresql.org; Sat, 10 Feb 2018 17:21:47 +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 1ekYqQ-0006eM-Ca for pgsql-general@arkaria.postgresql.org; Sat, 10 Feb 2018 17:21:46 +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 1ekYqQ-0006dx-1X for pgsql-general@lists.postgresql.org; Sat, 10 Feb 2018 17:21:46 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ekYqN-0000HA-0Y for pgsql-general@postgresql.org; Sat, 10 Feb 2018 17:21:44 +0000 Received: by mail-wm0-x244.google.com with SMTP id f3so2851503wmc.1 for ; Sat, 10 Feb 2018 09:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2v+SErBcXWxC9sDf7ZML+MRvez8GinRwc7ucEQZpO20=; b=wKFnj6pIMWZV6Di9kwI8vcKviZiXpRtT0BOVzmhIPWvhkGLs+jOY4lY+jEdL0EGhRS v7Wed7SSAplLTfHFdJ04Q8OefAWUY4Aq/9asTIJxNdYvQQCDTGX1WXL/rVSg7BLGK236 D4KoNP85GdOkZyxGUl9xRGFcAkJ6IYcrTpmagEnvECP6STtsxV/R1TpZMnXnWIaCY/w4 k5aaX6aKH2tPW42DOEiG+r0LI8q44P0ok5TkN6n7bR7f8dXUS8GZ6rlYVQ/FR7AfegwU K6RoKmVWOqeaU4gcWV/qg0cutxYrJSiRiYfpmRdIOayjE8jvQFngUQ1BzR/d/gq0wAwD 0oxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2v+SErBcXWxC9sDf7ZML+MRvez8GinRwc7ucEQZpO20=; b=Rm93iP82EVjDDnSfxkzDw0lmGW1crkv4Be+863rU8CWoxhIXr8SD2ZjtcXX/MZZL0Y /Lv5vJJdyiUciHCGkq55Y27MNDfD7fykOSDk8aTg2aQpFgVcn5mWMBBvIeknWm3LWkIU 8Bwwm3CoCcRwLQlSXGo68SzMtY8acFY5vtrT2QCuct64Z/8IBs2HA1JdV6CV2ZOrrp61 ZsRty88djapGUOWh9bcqb4WSY2ot6GxvE3o74EoiMXWWAGAHOtJDU74PALUc66qcR/9J gvjqk/jsVfcm5lMvpbgRh05TNryCI2XHnyOrO0i6P4DChSjKopSjRWW9w1ZL2ZA3+rJk nvTw== X-Gm-Message-State: APf1xPAtN+1msA9cACefK/K9rC5uAPVStboDZNMl3yXLRmyvbUd4tRmh tw3vAJ3lPimx/JPKJBdOwv4qAaxVTV/p450yJ8+jpk94AwwK2WjslbfLlVvfWDle/PRLNqxdPM0 i/CcLjRkvzD4sHjbUmrsiBRrLouaJ2ciDOKiB0ZGQ6AcSdvTDOTUB5Kqf8jYBAbcF5MRBigAwjg CX6QWrY8X+ X-Google-Smtp-Source: AH8x226Ua36YggP68re6af2s32lsrarRGHn5FHrGxxO5xC0RvGTgm/BMp9T0HvFMxPZrmfwldEzLpA== X-Received: by 10.28.107.134 with SMTP id a6mr4913206wmi.136.1518283300358; Sat, 10 Feb 2018 09:21:40 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id h200sm1431326wme.11.2018.02.10.09.21.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 09:21:39 -0800 (PST) Subject: Re: New Copy Formats - avro/orc/parquet To: Nicolas Paris , Adrian Klaver Cc: pgsql-general@postgresql.org References: <20180210151304.fonjztsynewldfba@gmail.com> <78a8f0bd-4b6f-b791-b6ce-80b19e2b6d1b@aklaver.com> <20180210153011.o2w3tdriqmwvahph@gmail.com> From: Tomas Vondra Message-ID: <3274b427-fe3a-89fc-2302-52082bf817aa@2ndquadrant.com> Date: Sat, 10 Feb 2018 18:21:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180210153011.o2w3tdriqmwvahph@gmail.com> Content-Type: text/plain; charset=utf-8 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 04:30 PM, Nicolas Paris wrote: >>> 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. >> " >> > > PROGRAM would involve overhead of transforming data from CSV or > BINARY to AVRO for example. > > Here, I am talking about native format exports/imports for > performance considerations. > That is true, but the question is how significant the overhead is. If it's 50% then reducing it would make perfect sense. If it's 1% then no one if going to be bothered by it. Without these numbers it's hard to make any judgments. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services