Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on July 29, 2015 5:19PM
Likes: 0
Replies: 4
I am not aware of a possibility to do so directly in the GUI, but if too tedious to do it by hand, you might want to edit
DATA_DIR/config/projects/PROJECTFOO/datasets/datasetbar.json
through a script. Here, datasetbar is the input dataset to the sync recipe. Then
If your dataset fits in memory, I would replace the sync recipe by a Python recipe that change the column names and then copy its input to its output. This way there is no unnecessary duplication of data.
Hi,
Here is a solution that might work in Visual Preparation scripts (under Analysis):
import json
def process(row):
columns = row.keys()
o = {}
for column in columns:
new_name = str(column).lower()
o[new_name] = row[column]
return json.dumps(o)
That's it. You end up with a view of your dataset where all the columns are lowered.
NOTE: this is not the best solution since you still need to build your dataset at the end, so this may create a not-so-necessary copy of your base dataset.
If you want to lower the column name because of PostegreSQL, the solution might be to double quote the column name in your SQL code:
select "MyColomn1", mycolumn2 from "MyTable";
More info here.
Hi,
If you would like to do it using a recipe and not code scripts. You can change:
1) from table view to column view
2) Select all columns or those you would like to rename
3) Select actions and from their menu, rename
4) From rename menu choose convert to lowercase