Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BA309F6B for ; Tue, 12 Jun 2012 09:59:02 +0000 (UTC) Received: (qmail 7063 invoked by uid 500); 12 Jun 2012 09:59:00 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 6893 invoked by uid 500); 12 Jun 2012 09:59:00 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 6874 invoked by uid 99); 12 Jun 2012 09:58:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2012 09:58:59 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rizalp@gmail.com designates 209.85.160.180 as permitted sender) Received: from [209.85.160.180] (HELO mail-gh0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2012 09:58:52 +0000 Received: by ghbz12 with SMTP id z12so3521102ghb.11 for ; Tue, 12 Jun 2012 02:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=hMW7yJUKUQSx5FqyeOYTgzdZpqEM+5coT7kqiy3idnA=; b=Rv8xGawAvmqdt1W6mgbwiZ7bOLpEx9PhmzkUv7GZPRiG8k3b3cJPBOrkguB3WGe0U9 t+Ak7wZ3UtK/P9n2QKuxk4DDvkanBiTZFKEB/OFM9u1E97xwXynAX858tYd9Pcvy9VbJ N+VldFXh34GDxWRuOSPg0PPWS0IFdO1Ao29rW8UOMpERSZ0fco/tJx3AI8YhWdHgIQcC GgzPOBMfOkAKMluiIbx+P8M20iPGjVodGrB2eicNG7zFdbn1Tc6Ni496ssFL2+CPnUnm KrzJAC1V38DjcyRL7q7bAh6SnETULYlJTWuzIkimWutgmgohyxiLHU32BYE3GFVcTlQ8 IVbQ== MIME-Version: 1.0 Received: by 10.60.25.100 with SMTP id b4mr19459022oeg.64.1339495111786; Tue, 12 Jun 2012 02:58:31 -0700 (PDT) Received: by 10.76.2.142 with HTTP; Tue, 12 Jun 2012 02:58:31 -0700 (PDT) In-Reply-To: References: <93C87D8E-D891-4C54-B7AC-A621A68A11C9@apache.org> Date: Tue, 12 Jun 2012 16:58:31 +0700 Message-ID: Subject: Re: How to do Bulk-insert from Huge JSON File (460 MB) From: Mohammad Prabowo To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=e89a8ff2518250fef004c243825d --e89a8ff2518250fef004c243825d Content-Type: text/plain; charset=ISO-8859-1 Would you please tell me the curl syntax to upload the file as multipart? I've been scratching my head, and can't even find it from the curl's manual.. On Tue, Jun 12, 2012 at 4:10 PM, CGS wrote: > You said your file is 465 MB, but cURL is sending only > > > Content-Length: 439203931 > > which raised a multipart file transmission which never occurred: > > > Expect: 100-continue > > Try either multipart file or split your JSON in smaller files (2 files > should be enough). > > CGS > > > > > On Tue, Jun 12, 2012 at 10:42 AM, Mohammad Prabowo > wrote: > > > I can only see indication in Couch.log as if nothing happened. I've tried > > using smaller JSON file (4K) and it run successfully. > > I'm using couchDB 1.2 > > > > On Tue, Jun 12, 2012 at 11:38 AM, Dave Cottlehuber > > wrote: > > > > > On 12 June 2012 06:27, Mohammad Prabowo wrote: > > > > Still no result. I guess i have to split it into smaller documents.. > > > > > > > > On Mon, Jun 11, 2012 at 7:03 PM, Robert Newson > > > wrote: > > > > > > > >> > > > >> -d will load the whole file into memory and also interpret it as > > ascii, > > > >> which might make it invalid. > > > >> > > > >> use -T instead. > > > >> > > > >> B. > > > >> > > > >> On 11 Jun 2012, at 12:29, Mohammad Prabowo wrote: > > > >> > > > >> > Hi. I need to do bulk-insert of document in my CouchDB database. > > > >> > I'm trying to follow the manual here: > > > >> > http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API > > > >> > > > > >> > Here is my code: > > > >> > > > > >> > ~$ DB="http://localhost:5984/employees" > > > >> > ~$ curl -H "Content-Type:application/json" -d > > > >> @employees_selfContained.json > > > >> > -vX POST $DB/_bulk_docs > > > >> > > > > >> > the file employees_selfContained.json is a huge file = 465 MB. > I've > > > >> > validated it using JSONLint and found nothing wrong > > > >> > Here's the curl's verbose output: > > > >> > > > > >> > curl -H "Content-Type:application/json" -d > > > @employees_selfContained.json > > > >> > -vX POST $DB/_bulk_docs > > > >> > * About to connect() to 127.0.0.1 port 5984 (#0) > > > >> > * Trying 127.0.0.1... connected > > > >> > * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0) > > > >> >> POST /employees/_bulk_docs HTTP/1.1 > > > >> >> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 > > > >> OpenSSL/0.9.8k > > > >> > zlib/1.2.3.3 libidn/1.15 > > > >> >> Host: 127.0.0.1:5984 > > > >> >> Accept: */* > > > >> >> Content-Type:application/json > > > >> >> Content-Length: 439203931 > > > >> >> Expect: 100-continue > > > >> >> > > > >> > < HTTP/1.1 100 Continue > > > >> > * Empty reply from server > > > >> > * Connection #0 to host 127.0.0.1 left intact > > > >> > curl: (52) Empty reply from server > > > >> > * Closing connection #0 > > > >> > > > > >> > How can i do bulk-insert from that Huge single file? I prefer not > to > > > >> split > > > >> > the file into smaller size if possible.. > > > >> > > > >> > > > > > > > > > Mohammed, > > > > > > What do you see in the couch.log ? > > > > > > I'd be interested to hear if this same upload works against 1.1.1 vs > > 1.2.0. > > > > > > Thanks > > > Dave > > > > > > --e89a8ff2518250fef004c243825d--