You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by "anubhav tarar (JIRA)" <ji...@apache.org> on 2018/03/19 07:53:00 UTC

[jira] [Assigned] (CARBONDATA-2263) Date data is loaded incorrectly.

     [ https://issues.apache.org/jira/browse/CARBONDATA-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

anubhav tarar reassigned CARBONDATA-2263:
-----------------------------------------

    Assignee: anubhav tarar

> Date data is loaded incorrectly.
> --------------------------------
>
>                 Key: CARBONDATA-2263
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2263
>             Project: CarbonData
>          Issue Type: Bug
>    Affects Versions: 1.3.0
>            Reporter: Sangeeta Gulia
>            Assignee: anubhav tarar
>            Priority: Minor
>         Attachments: dataSample.csv
>
>
> When we set :
> CarbonProperties.getInstance()
> .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, "yyyy/mm/dd")
> and run below commands: 
> spark.sql("DROP TABLE IF EXISTS t3")
> spark.sql(
> s"""
> | CREATE TABLE IF NOT EXISTS t3(
> | ID Int,
> | date Date,
> | country String,
> | name String,
> | phonetype String,
> | serialname String,
> | salary Int,
> | floatField float
> | ) STORED BY 'carbondata'
> """.stripMargin)
> spark.sql(s"""
> LOAD DATA LOCAL INPATH '$testData' into table t3
> options('ALL_DICTIONARY_PATH'='$allDictFile', 'SINGLE_PASS'='true')
> """)
> spark.sql("""
> SELECT * FROM t3
> """).show()
> spark.sql("""
> SELECT * FROM t3 where floatField=3.5
> """).show()
> spark.sql("DROP TABLE IF EXISTS t3")
> Date data is loaded as below: 
> +---+----------+-------+-----+---------+----------+------+----------+
> | id| date|country| name|phonetype|serialname|salary|floatfield|
> +---+----------+-------+-----+---------+----------+------+----------+
> | 9|2015-01-18| china| aaa9| phone706| ASD86717| 15008| 2.34|
> | 10|2015-01-19| usa|aaa10| phone685| ASD30505| 15009| 2.34|
> | 1|2015-01-23| china| aaa1| phone197| ASD69643| 15000| 2.34|
> | 2|2015-01-24| china| aaa2| phone756| ASD42892| 15001| 2.34|
> | 3|2015-01-25| china| aaa3|phone1904| ASD37014| 15002| 2.34|
> | 4|2015-01-26| china| aaa4|phone2435| ASD66902| 15003| 2.34|
> | 5|2015-01-27| china| aaa5|phone2441| ASD90633| 15004| 2.34|
> | 6|2015-01-28| china| aaa6| phone294| ASD59961| 15005| 3.5|
> | 7|2015-01-29| china| aaa7| phone610| ASD14875| 15006| 2.34|
> | 8|2015-01-30| china| aaa8|phone1848| ASD57308| 15007| 2.34|
> +---+----------+-------+-----+---------+----------+------+----------+
>  
> However correct data is : 
> ID,date,country,name,phonetype,serialname,salary,floatField
> 1,2015/7/23,china,aaa1,phone197,ASD69643,15000,2.34
> 2,2015/7/24,china,aaa2,phone756,ASD42892,15001,2.34
> 3,2015/7/25,china,aaa3,phone1904,ASD37014,15002,2.34
> 4,2015/7/26,china,aaa4,phone2435,ASD66902,15003,2.34
> 5,2015/7/27,china,aaa5,phone2441,ASD90633,15004,2.34
> 6,2015/7/28,china,aaa6,phone294,ASD59961,15005,3.5
> 7,2015/7/29,china,aaa7,phone610,ASD14875,15006,2.34
> 8,2015/7/30,china,aaa8,phone1848,ASD57308,15007,2.34
> 9,2015/7/18,china,aaa9,phone706,ASD86717,15008,2.34
> 10,2015/7/19,usa,aaa10,phone685,ASD30505,15009,2.34
>  
> which says Month data is loaded incorrectly.
>  
> Similarly, if we use :
> CarbonProperties.getInstance()
> .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, "YYYY/mm/dd")
> it again store incorrect data for date.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)