metering-operator icon indicating copy to clipboard operation
metering-operator copied to clipboard

Import MairaDB Data in Datasource

Open JooyoungJeong opened this issue 5 years ago • 5 comments

Hi. I want to put the value of the table in MariaDB into the Datasource. What should I do? ex)

  • MariaDB

  • table-name: table_test

timestamp element value
2019-03-18 01:04:00.000 A 12
2019-03-19 01:04:00.000 A 10

I want to put the data into the datasource as shown below.

  • Datasource
  • Datasource-name: test-mariadb-table

select * from test-mariadb-table

timestamp element value
2019-03-18 01:04:00.000 A 12
2019-03-19 01:04:00.000 A 10

How can I create a datasource yaml, and what api can I put data in?

Thank you

JooyoungJeong avatar Mar 21 '19 05:03 JooyoungJeong

This currently isn't supported. Presto supports connecting to mysql, and we've got some upcoming work that would make this easier, but currently there isn't any support for this.

chancez avatar Mar 21 '19 17:03 chancez

If you're interested, we define the Presto catalogs here: https://github.com/operator-framework/operator-metering/blob/master/charts/presto/templates/_helpers.tpl#L1-L17 and here: https://github.com/operator-framework/operator-metering/blob/master/charts/presto/templates/presto-catalog-config-secret.yaml with default values coming from https://github.com/operator-framework/operator-metering/blob/master/charts/presto/values.yaml

You could then configure presto to access your MySQL database using by updating the templates to configure the mysql connector based on the upstream docs: https://prestodb.github.io/docs/current/connector/mysql.html

chancez avatar Mar 21 '19 17:03 chancez

I'd also like to mention, that upcoming work is a rewrite of how we manage tables, and will allow you to do this stuff more easily, though we would still need support for configuring presto to use mysql as a connector (relatively simple though).

chancez avatar Mar 21 '19 17:03 chancez

I started an initial PR to make it so you can configure Presto to access other databases here https://github.com/operator-framework/operator-metering/pull/650

See the PR for details/examples.

chancez avatar Mar 21 '19 17:03 chancez

@chancez Thank you for your feedback! https://github.com/operator-framework/operator-metering/pull/650 this is nice work!

JooyoungJeong avatar Mar 25 '19 03:03 JooyoungJeong