Skip to main content
Solved

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


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

Murad Sæter wrote:

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.

View original
Did this topic help you find an answer to your question?

2 replies

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

In RAW, all columns are stored as a string.


Forum|alt.badge.img
Murad Sæter wrote:

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.


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings