I have managed to get my model to show up in Melta...
# announcements
r
I have managed to get my model to show up in Meltano UI. To start I am using a very minimal model, as given below:
Copy code
test_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:
Copy code
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:
Copy code
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?
m
connection is deprecated, so it should not matter anymore. The
analytics
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.
Just make sure there is data in the
analytics.test_test
table and it should be good
r
There is data in
analytics.test_test
. I can query it using the second SQL I have posted.
I added
set search_path to analytics
before and now the Meltano query is working from psql console
But the query is not giving output in web UI.
It just shows the progress bar...
This is what I see in the web ui when I try to run the query.
m
Do you have any error in the console or in the response?
a
Do you have any type of aggregation defined in your config?
r
Today morning it magically started working. There was no error in the console. I have not yet defined any aggregation
I have successfuly got Metlano to display a basic report, at long last 🙂 Now on to making it more useful!