Skip to content
Last updated

Modifying or Customizing the Table Schema

There are two ways to update a table Schema Management.

Using TD Console

To update schema manually, navigate to:

  1. Open TD Console.

  2. Navigate to Data Workbench > Databases.

  3. Select a database for which you want to modify the schema. For example, test_db or:

4. Select a table. For example:

  1. Select Add Column.

  1. Specify the table metadata details. For example:

  1. Select Save.

  2. Optionally, to continue customizing the schema and metadata, select Edit Schema.

  1. Optionally, to continue customizing the schema and metadata, select Add Column.

  2. Optionally, to delete a column from your table, select Edit Schema and select the x to the far right of the page.

  3. Optionally, select … > Table Settings.

  1. Optionally, make selections on Edit Settings.

  2. Optionally, select Confirm.

  3. Select Save when your schema modification is complete.

Using TD CLI Tool

Alternatively, you can use the td schema:set command

  • where <column_name> consists of lowercase alphabets, numbers, and "_" only

  • where <type> can be one of the following: int, long, double, float, string, array<T>

$ td schema:set <database> <table> <column_name>:<type>...

For this example, the schema would be added as follows:

td schema:set testdb www_access action:string labels:'array<string>' user:int

You can see the following articles for more query syntax:

Treasure Data, Presto, and Hive Schema Relation

Treasure DataPrestoHive
intbigintsmallint
intbigintint
longbigintbigint
doubledoubledecimal
floatdoublefloat
doubledoubledouble
Convert to string or intbooleanboolean
stringvarcharstring or varchar
string or Convert to longdatestring
string or Convert to longtimestamptimestamp

You can refer to the open-source documentation as well: