raj
12/11/2019, 7:38 AMtest_test.table.m5o
{
version = 1
sql_table_name = analytics.test_test
name = test_test
columns {
id {
primary_key = true
hidden = true
type = integer
sql = "{{table}}.id"
}
country_code {
label = Country
description = Country
type = string
sql = "{{table}}.country_code"
}
}
}
test.topic.m5o
{
version = 1
name = test
connection = postgres_db
label = Test Analytics
designs {
test_test {
label = Test
from = test_test
description = "Test analytics"
}
}
}
When I run this model, following SQL is generated by Meltano:
SELECT
"test_test"."country_code" "test_test.country_code"
FROM
"test_test" "test_test"
GROUP BY
"test_test.country_code"
ORDER BY
"test_test.country_code" ASC
LIMIT
50;
which is wrong, and the correct SQL is:
SELECT
"test_test"."country_code" "test_test.country_code"
FROM
analytics.test_test
GROUP BY
"test_test.country_code"
ORDER BY
"test_test.country_code" ASC
LIMIT 50;
Difference is in the FROM clause. What change should I make in my model so that the FROM clause gets correct data?
Also topic.m5o has a connection = postgres_db attribute. Where can I find the name of the postgres connection I should be using?micael_bergeron
12/11/2019, 1:25 PManalytics schema is automatically injected for you, i.e. Meltano issues a set search_path to analytics at the start of the connection so it should work without it.micael_bergeron
12/11/2019, 1:26 PManalytics.test_test table and it should be goodraj
12/11/2019, 1:34 PManalytics.test_test. I can query it using the second SQL I have posted.raj
12/11/2019, 2:07 PMset search_path to analytics before and now the Meltano query is working from psql consoleraj
12/11/2019, 2:08 PMraj
12/11/2019, 2:08 PMraj
12/11/2019, 2:10 PMmicael_bergeron
12/11/2019, 4:25 PMal_whatmough
12/11/2019, 10:22 PMraj
12/12/2019, 5:20 AMraj
12/12/2019, 8:11 AM