[ https://issues.apache.org/jira/browse/CARBONDATA-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16060325#comment-16060325 ] chenerlu edited comment on CARBONDATA-1203 at 6/23/17 2:36 AM: --------------------------------------------------------------- Hi, I encounter same problem. Issue can be summarized as follows. Step 1: create a carbon table. cc.sql("CREATE TABLE IF NOT EXISTS t3 (id Int, name String) STORED BY 'carbondata'") Step 2: load data, then t3 will have 10 records cc.sql("LOAD DATA LOCAL INPATH 'mypathofdata' INTO TABLE t3 ") Step 3: insert constant into table t3 cc.sql("INSERT INTO TABLE t3 SELECT 1, 'jack' FROM t3") Step4: count table t3 cc.sql("SELECT count (\*) FROM t3") Actual result: t3 will have 20 records. (20 records = 10 + 10, the second '10' is because t3 has 10 records, if we change t3 to t4 which have 5 records, the result will be 15, so I think carbondata handle constant as '\*', not sure, this should be confirm). Expected result: t3 should have 11 records or throw sql.AnalysisException (This will be same as Hive table I think) Any idea about this issue, which solution is better ? [~ravi.pesala] [~chenliang613] was (Author: chenerlu): Hi, I encounter same problem. Issue can be summarized as follows. Step 1: create a carbon table. cc.sql("CREATE TABLE IF NOT EXISTS t3 (id Int, name String) STORED BY 'carbondata'") Step 2: load data, then t3 will have 10 records cc.sql("LOAD DATA LOCAL INPATH 'mypathofdata' INTO TABLE t3 ") Step 3: insert constant into table t3 cc.sql("INSERT INTO TABLE t3 SELECT 1, 'jack' FROM t3") Step4: count table t3 cc.sql("SELECT count (\*) FROM t3") Actual result: t3 will have 20 records. Expected result: t3 should have 11 records or throw sql.AnalysisException (This will be same as Hive table I think) Any idea about this issue, which solution is better ? [~ravi.pesala] [~chenliang613] > insert data caused many duplicated data on spark 1.6.2 > ------------------------------------------------------- > > Key: CARBONDATA-1203 > URL: https://issues.apache.org/jira/browse/CARBONDATA-1203 > Project: CarbonData > Issue Type: Bug > Reporter: Jarck > > I use branch-1.1 do insert test on spark 1.6.2 in my local machine > I try to run the sql as below to insert a data > spark.sql(s""" > insert into $tableName select $id,'$date','$country','$testName' > ,'$phoneType','$serialname',$salary from $tableName > """).show() > at last the data has been inserted successfully, but it inserted many duplicated data -- This message was sent by Atlassian JIRA (v6.4.14#64029) |
Free forum by Nabble | Edit this page |