-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CARBONDATA-3083] Fixed data mismatch issue after update #2902
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-30000,aaa,-300 | ||
0,ddd,0 | ||
-20000,bbb,-200 | ||
70000,ggg,700 | ||
10000,eee,100, | ||
-10000,ccc,-100, | ||
null,null,null |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -772,12 +772,33 @@ class UpdateCarbonTableTestCase extends QueryTest with BeforeAndAfterAll { | |
sql("""drop table if exists iud.dest33_part""") | ||
} | ||
|
||
test("check data after update with row.filter pushdown as false") { | ||
CarbonProperties.getInstance().addProperty(CarbonCommonConstants | ||
.CARBON_PUSH_ROW_FILTERS_FOR_VECTOR, "false") | ||
sql("""drop table if exists iud.dest33_flat""") | ||
sql( | ||
"""create table iud.dest33_part (c1 int,c2 string, c3 short) STORED BY 'carbondata'""" | ||
.stripMargin) | ||
sql( | ||
s"""LOAD DATA LOCAL INPATH '$resourcesPath/IUD/negativevalue.csv' INTO table iud | ||
|.dest33_part options('header'='false')""".stripMargin) | ||
sql( | ||
"""update iud.dest33_part d set (c1) = (5) where d.c1 = 0""".stripMargin).show() | ||
checkAnswer(sql("select c3 from iud.dest33_part"), Seq(Row(-300), Row(0), Row(-200), Row(700) | ||
, Row(100), Row(-100), Row(null))) | ||
sql("""drop table if exists iud.dest33_part""") | ||
CarbonProperties.getInstance().addProperty(CarbonCommonConstants | ||
.CARBON_PUSH_ROW_FILTERS_FOR_VECTOR, "true") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After test case completion we should set the default value for |
||
} | ||
|
||
override def afterAll { | ||
sql("use default") | ||
sql("drop database if exists iud cascade") | ||
CarbonProperties.getInstance() | ||
.addProperty(CarbonCommonConstants.isHorizontalCompactionEnabled , "true") | ||
CarbonProperties.getInstance() | ||
.addProperty(CarbonCommonConstants.ENABLE_VECTOR_READER , "true") | ||
CarbonProperties.getInstance().addProperty(CarbonCommonConstants | ||
.CARBON_PUSH_ROW_FILTERS_FOR_VECTOR, "false") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of hard coding |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using
putShorts/putFloats
is common and unavoidable. In future also any new encoding class can make use of these method and then again the same problem can occur. Is it feasible to modify the vector classes implementation methods itself just like an example belowpublic void putShorts(int rowId, int count, short[] src, int srcIndex) { for (int i = srcIndex; i < count; i++) { putShort(rowId++, src[i]); } }
This way it will be better