The following ingestion spec will help renaming dimension during ingestion while keep its values intact. In this case, original column names are `user` and `regionName`, and after ingestion, the column names are changed to `RENAME_User` and "RENAME_RegionName` in dataSource:
{ "type" : "index", "spec" : { "dataSchema" : { "dataSource" : "wikipedia-rename", ... "dimensionsSpec" : { "dimensions" : [ "RENAME_User", .... "RENAME_RegionName", ... ] } } }, ... "transformSpec" : { "filter" : null, "transforms" : [ { "type" : "expression", "name" : "RENAME_User", "expression" : "(\"user\")" }, { "type" : "expression", "name" : "RENAME_RegionName", "expression" : "(\"regionName\")" } ] } } ... }
Comments
2 comments
Can you please clarify this statement: "In this case, original column names are `user` and `regionName`, and after ingestion, the column names are changed to `RENAME_User` and "RENAME_RegionName` in dataSource" ?
Isn't column name changed during or before ingesting data into data source ?
I think you are right. The column names are changed DURING the ingestion to be precise. Users will see the new column names in the Druid dataSource after the ingestion is done, though.
Please sign in to leave a comment.