Join us in Las Vegas on June 13-16 for the Snowflake Summit

Learn More
Get Started Transforming Your Data in Snowflake

How to stop TinyInt converting to Boolean in Looker?

  • Datameer, Inc.
  • January 22, 2018

PROBLEM STATEMENT: 

It has been observed that if we use Looker with a MySQL 5.6 connection, and if we query a tinyint column, the values are converted to boolean by Looker. 

For Example: 

Consider the following SQL where test_tiny_int column in the test_table holds tiny_int values

SELECT distinct test_tiny_int FROM test_table

The above query returns the following results in Looker

If you run the same query directly in MySQL, it returns the following result set:


Use cast function in LookML when defining the SQL parameter for the dimension so that the resulting SQL resolves to the following SOLUTION

SELECT distinct cast(test_tiny_int) FROM test_table

That is how to stop a TinyInt from converting to Boolean in Looker.


Up Next:

Read How to merge two Explores in Looker?

More Resources We Think You Might Like

How to create a funnel chart visualization in Looker?

How to create a funnel chart visualization in L...

A Funnel chart is best used to understand the linear sequence of events, such as search movement ...

  • Looker FAQs
  • January 15, 2018
How to create a funnel chart visualization in Looker?

How to add custom visualization in Looker using...

In Looker, there are two ways to add custom visualizations using Javascript: Adding a custom visu...

  • Looker FAQs
  • January 15, 2018
How to create a funnel chart visualization in Looker?

How to show the column value labels in Looker

This post explains how to show the column value labels in Looker without changing the value label...

  • Looker FAQs
  • January 15, 2018