lens-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tao Yan <t...@linkedin.com>
Subject Adding MySQL as a Data Source
Date Fri, 26 Aug 2016 22:12:25 GMT
Hi Lens Developers,

I am trying to add mysql as a data source, so, I created the driver as
follows:

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <property>
    <name>lens.driver.jdbc.driver.class</name>
    <value>com.mysql.jdbc.Driver</value>
  </property>
  <property>
    <name>lens.driver.jdbc.db.uri</name>

<value>jdbc:mysql://****mysql**hostname****/lens;user=****;passowrd=****</value>
  </property>
  <property>
    <name>lens.driver.jdbc.db.user</name>
    <value>****</value>
  </property>
  <property>
    <name>lens.cube.query.driver.supported.storages</name>
    <value>mysql</value>
    <final>true</final>
  </property>
  <property>
    <name>lens.driver.jdbc.query.rewriter</name>
    <value>org.apache.lens.driver.jdbc.ColumnarSQLRewriter</value>
  </property>
  <property>
    <name>lens.driver.jdbc.explain.keyword</name>
    <value>explain plan for </value>
  </property>
</configuration>

And created a test table with data in mysql:

create table dimension1_subset (
primary_key BIGINT(8) not null primary key,
attr1 BIGINT(8),
attr5 BIGINT(8)
);


‚Äč
And created the storage file:

<?xml version="1.0" encoding="UTF-8"?>

<x_storage classname="org.apache.lens.storage.db.DBStorage" name="mysql"
xmlns="uri:lens:cube:0.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
  <properties>
    *<property name="lens.storage.db.url"
value="jdbc:mysql://lva1-db34.corp.linkedin.com/lens
<http://lva1-db34.corp.linkedin.com/lens>"/>*
  </properties>
</x_storage>

I am confused when set the value for *lens.storage.db.url *because* it is
neither local filesystem nor HDFS.*

And I don't know what should the storage table look like:

<x_dimension_table dimension_name="dimension1"
table_name="dimension1_table3" weight="5.0" xmlns="uri:lens:cube:0.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
  <columns>
    <column name="primary_key" _type="BIGINT"/>
    <column name="attr1" _type="BIGINT"/>
    <column name="attr5" _type="BIGINT"/>
  </columns>
  <properties>
    <property name="dimension1.prop" value="t3"/>
  </properties>
  <storage_tables>


*    <storage_table>      ...    </storage_table>*
  </storage_tables>
</x_dimension_table>

What should I use for the table_location, and what about part_cols? How do
I add data to this table?

Thanks,
-- 

*Tao Yan*
Software Engineer
Data Analytics Infrastructure Tools and Services



206.250.5345
tyan@linkedin.com
https://www.linkedin.com/in/taousc

Mime
View raw message