I'm facing below error in CrateDB after upgrading Crate version 4.1.8
to 4.2.7
error during main processing: SQLActionException[UnsupportedFeatureException: Unknown function: to_object_array(db_name.tbl_name."object_array_type_col_name")]
error : {
"message": "SQLActionException[UnsupportedFeatureException: Unknown function: to_object_array(db_name.tbl_name."object_array_type_col_name")]",
"code": 4004
}
I'm trying to move data from one table to another using INSERT INTO
with subsql query statement in CrateDB from existing table having column with data types OBJECT(DYNAMIC)
and ARRAY(OBJECT(DYNAMIC))
and creating temp table with original schema of existing table.
As there is a column_policy = 'dynamic'
at table level in original table, there are couple of columns added dynamically with same data types OBJECT(DYNAMIC)
and ARRAY(OBJECT(DYNAMIC))
.
Below is the full SQL query which I'm using to move the data which is working fine on Crate version 4.1.8
and raise above exception on version 4.2.7
.
INSERT INTO temp_tbl (col1, col2_object, col3_object_array, col4, col5, dynamic_col6_object, dynamic_col6_object_array) (SELECT col1, to_object(col2_object), to_object_array(col3_object_array), col4, col5, to_object(dynamic_col6_object), to_object_array(dynamic_col6_object_array) FROM original_tbl);
UPDATE 1:
As mentioned/pointed by @proddata, I did try CAST but facing the below error
error: { "message": "SQLActionException[SQLParseException: The type 'object' of the insert source 'object_col_name' is not convertible to the type 'object' of target column 'object_col_name']", "code": 4000 }