Pivot Table not working with Custom queries

Metabase is running within Digital Ocean droplet, able to connect to DB and browse/run queries

So, am doing "Ask Question" -> "Native query" -> trying this plain query, which is working fine.

select field1, sum(field2) from table_sample group by field1

But when trying to create pivot table visuablisation for this, getting error "Pivot tables can only be used with aggregated queries." where above query is an example of aggregate query only.

In Pivot table documentation, it's using query builder and then pivot table is working fine, but with Native query it keeps throwing this error.