Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-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 9B72D10B7E for ; Sun, 29 Sep 2013 17:53:43 +0000 (UTC) Received: (qmail 73018 invoked by uid 500); 29 Sep 2013 17:53:40 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 72926 invoked by uid 500); 29 Sep 2013 17:53:38 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 72918 invoked by uid 99); 29 Sep 2013 17:53:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Sep 2013 17:53:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tcpandip@gmail.com designates 209.85.219.53 as permitted sender) Received: from [209.85.219.53] (HELO mail-oa0-f53.google.com) (209.85.219.53) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Sep 2013 17:53:32 +0000 Received: by mail-oa0-f53.google.com with SMTP id i7so3311942oag.12 for ; Sun, 29 Sep 2013 10:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=OPSPR2Gt8pYdZ36bUggkatr3KyA7ybhDvhljptAP9gg=; b=xpgw5ZTfpRW9cAzjZtx3Ccf3G8VbYK2K0H0aBN90PsztIuFUWKmYXIgDSwB5/Xlhl/ yViVhW713DskMRP9BowJh9PHOf4Sz8uWRtDTMDN3L7x7Uly+4/fAQ/U7+nxH5GjTpCQC hLSOYvXVK8u9v190uAz5XOQhkPil/sZsuAoiFaKiYJJKneOHSn1+enm4KFEa24DUoav5 yQPD9usMg0ajjRtf945/+aHboVE90bz2O2G5nrCsUjvDbZ+Qr1gDsqAzkFMRfBeAjtxy 4vTC3k0c1z9LZOBG4+TncSFFKOqRISUNfhWd8KTfmPBuXLoLqBpK9kn2KnpSxHPpvgyY ErOg== X-Received: by 10.60.63.167 with SMTP id h7mr1741578oes.43.1380477192146; Sun, 29 Sep 2013 10:53:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.34.168 with HTTP; Sun, 29 Sep 2013 10:52:52 -0700 (PDT) From: Justin Date: Sun, 29 Sep 2013 13:52:52 -0400 Message-ID: Subject: Odd issue with datetime field To: user@avro.apache.org Content-Type: multipart/alternative; boundary=001a11c213a4a8982404e789643e X-Virus-Checked: Checked by ClamAV on apache.org --001a11c213a4a8982404e789643e Content-Type: text/plain; charset=ISO-8859-1 Hello, I'm importing data from MySQL to HDFS with Sqoop. The import seems to go well. $ hadoop fs -ls /user/hive/warehouse/acme/mydb/mytable Found 66 items ... -rw-r--r-- 3 cloudera hive 939604786 2013-09-29 11:20 /user/hive/warehouse/acme/mydb/mytable/part-m-00001.avro -rw-r--r-- 3 cloudera hive 955864250 2013-09-29 08:19 //user/hive/warehouse/acme/mydb/mytable/part-m-00002.avro ... I then proceed to create my schema and create the table in Hive. It's a fairly simply schema. All fields are integers (defined as int or long), except one, and that is a datetime (MySQL data type) field. Everything (seemingly) goes off without a hitch until I try to query the data in Hive. Here's the error I get when trying to do a simple "select count(*) from mytable" java.io.IOException: java.io.IOException: org.apache.avro.AvroTypeException: Found long, expecting string Again, the only column this could be is my datetime field. Well, at least, it's the only string field. The field is defined like so: {"name": "datefound", "type": "string" } I have confirmed all the datetime values coming from MySQL are in the standard "yyyy-mm-dd hh:mm:ss" format. Why would my jobs be encountering a integer? --001a11c213a4a8982404e789643e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,=A0

I'm importing data from M= ySQL to HDFS with Sqoop.

The import seems to go we= ll.

$ hadoop fs -ls /user/hive/warehouse/acme/mydb/mytable
Found 66 items=
...
-rw-r--r-- =A0 3 clo= udera hive =A0939604786 2013-09-29 11:20=A0/user/hive/warehouse/acme/mydb/m= ytable/part-m-00001.avro
-rw-r--r= -- =A0 3 cloudera hive =A0955864250 2013-09-29 08:19 //user/hive/warehouse/= acme/mydb/mytable/part-m-00002.avro
...

I then proceed to create my schema and create the table= in Hive. It's a fairly simply schema. All fields are integers (defined= as int or long), except one, and that is a datetime (MySQL data type) fiel= d.

Everything (seemingly) goes off without a hitch until I= try to query the data in Hive. Here's the error I get when trying to d= o a simple "select count(*) from mytable"

java.io.IOExcept= ion: java.io.IOException: org.apache.avro.AvroTypeException: Found long, ex= pecting string

Again, the only column= this could be is my datetime field. Well, at least, it's the only stri= ng field. The field is defined like so:

{= "name": "datefound", "type": "string&quo= t; }

I have confirmed all the datetime values coming from MySQL are = in the standard "yyyy-mm-dd hh:mm:ss" format.

Why would my jobs be=A0encountering= =A0a integer?=A0
--001a11c213a4a8982404e789643e--