Posted by
GitBox on
Jun 15, 2021; 5:27pm
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-maheshrajus-opened-a-new-pull-request-4150-CARBONDATA-4208-Wrong-Exception-receives-tp108900p108928.html
akashrn5 commented on a change in pull request #4150:
URL:
https://github.com/apache/carbondata/pull/4150#discussion_r652001282##########
File path: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java
##########
@@ -2648,4 +2648,6 @@ private CarbonCommonConstants() {
public static final String CARBON_SDK_EMPTY_METADATA_PATH = "emptyMetadataFolder";
+ public static final String CARBON_CONSTANT_DOT = ".";
+
Review comment:
already there is a constant called `POINT`, please use that, revert this
##########
File path: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
##########
@@ -3500,4 +3500,12 @@ public static void updateNullValueBasedOnDatatype(DataOutputStream dataOutputStr
dataOutputStream.write(CarbonCommonConstants.EMPTY_BYTE_ARRAY);
}
}
+
+ /**
+ * returns whether column is complex column based on column name for child column
+ * @return true if column is complex
+ */
+ public static boolean isComplexColumn(String colName) {
+ return colName.contains(".val") || colName.contains(CarbonCommonConstants.CARBON_CONSTANT_DOT);
Review comment:
use the constant called `POINT`
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestComplexDataType.scala
##########
@@ -765,6 +766,33 @@ class TestComplexDataType extends QueryTest with BeforeAndAfterAll {
assertResult("Unsupported operation on Complex data type")(arrayException.getMessage)
}
+ test("testing the long string properties for complex columns in main table") {
+ sql("drop table if exists complex1")
+ sql("drop table if exists complex2")
+ sql("drop table if exists complex3")
+ sql("create table complex1 (a int, arr1 array<string>) stored as carbondata")
+ assert(intercept[RuntimeException] {
+ sql("alter table complex1 SET TBLPROPERTIES ('LONG_STRING_COLUMNS'='arr1.val')")
+ }.getMessage
+ .contains(
+ "Alter table newProperties operation failed: Complex child column arr1.val cannot be set " +
+ "as LONG_STRING_COLUMNS"))
+ assert(intercept[MalformedCarbonCommandException] {
+ sql("create table complex2 (a int, arr1 array<string>) " +
+ "stored as carbondata TBLPROPERTIES('LONG_STRING_COLUMNS'='arr1.val')")
+ }.getMessage
+ .contains(
Review comment:
move this line above
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestComplexDataType.scala
##########
@@ -765,6 +766,33 @@ class TestComplexDataType extends QueryTest with BeforeAndAfterAll {
assertResult("Unsupported operation on Complex data type")(arrayException.getMessage)
}
+ test("testing the long string properties for complex columns in main table") {
+ sql("drop table if exists complex1")
+ sql("drop table if exists complex2")
+ sql("drop table if exists complex3")
+ sql("create table complex1 (a int, arr1 array<string>) stored as carbondata")
+ assert(intercept[RuntimeException] {
+ sql("alter table complex1 SET TBLPROPERTIES ('LONG_STRING_COLUMNS'='arr1.val')")
+ }.getMessage
+ .contains(
Review comment:
move this line above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]