Skip to main content
Answer

How can we know the data-type of RAW table column using APIs

  • October 3, 2023
  • 2 replies
  • 68 views

As Cognite provides APIs to access RAW tables from database, is there any way to get the actual datatype (text/bool/timestamp etc.) of the table’s column.

Best answer by Håkon V. Treider

In RAW, all columns are stored as a string.

The documentation says:

The columns object is a key value object, where the key corresponds to the column name while the value is the column value. It supports all the valid types of values in JSON, so number, string, array, and even nested JSON structure (see payload example to the right).

I think the correct answer to the question is that there is no enforced schema, so you can write data with different types to the same column.

2 replies

Murad Sæter
Practitioner
  • Practitioner
  • October 3, 2023

In RAW, all columns are stored as a string.


Forum|alt.badge.img

In RAW, all columns are stored as a string.

The documentation says:

The columns object is a key value object, where the key corresponds to the column name while the value is the column value. It supports all the valid types of values in JSON, so number, string, array, and even nested JSON structure (see payload example to the right).

I think the correct answer to the question is that there is no enforced schema, so you can write data with different types to the same column.