Git Product home page Git Product logo

spark-ods's Introduction

ASAM-ODS Data Source for Apache Spark

Requirements

  • Spark 2.0+ for 0.4.x.
  • ODS API library(ods-5.3.0.jar)

Build

$ sbt clean package

Features

Connecting ODS server via NameService with options

  • ns: CORBA NameService location.
  • name: registered ODS server name.
  • auth: ODS server authentication string.

ODS query

  • select:Multiple application attribute separated by ",".
  • join: Multiple application relation separated by ",".
  • where: Multiple query string and operator "AND|OR|OPEN|CLOSE" separated by ",".
  • group by: Multiple application attribute separated by ",".
  • order by: Multiple application attribute with option "ASC|DESC" separated by ",".

Measurment values retrieval from SubMatrix

  • submatrix: id of SubMatrix instance
  • channels: channel names separated by ","(optional).

Examples

ODS Query

scala> spark.read.format("jp.co.toyo.spark.ods")
		.option("ns", "corbaloc::1.2@localhost:2809/NameService")
		.option("name", "MDM.ASAM-ODS").option("auth", "USER=sa, PASSWORD=sa")
		.option("select", "MeaResult.Name,SubMatrix.Name,SubMatrix.Id")
		.option("join","MeaResult.SubMatrices=SubMatrix")
		.option("where", "MeaResult.Name EQ Channel, AND, MeaResult.DateCreated GTE 20160101000000")
		.option("order by", "MeaResult.MeasurementBegin DESC")
		.load()
		.show()
+--------------+------------+--------------+
|SubMatrix.Name|SubMatrix.Id|MeaResult.Name|
+--------------+------------+--------------+
|       Channel|        2011|       Channel|
+--------------+------------+--------------+


scala>

Measurment values

scala> spark.read.format("jp.co.toyo.spark.ods")
		.option("ns", "corbaloc::1.2@localhost:2809/NameService")
		.option("name", "MDM.ASAM-ODS")
		.option("auth", "USER=sa, PASSWORD=sa")
		.option("submatrix", 2011)
		.option("channels", "CHANNEL01, CHANNEL02, CHANNEL03, CHANNEL04, X-Axis")
		.load()
		.show()
+----------+---------+---------+---------+------+
| CHANNEL01|CHANNEL02|CHANNEL03|CHANNEL04|X-Axis|
+----------+---------+---------+---------+------+
|4.38541E-6|  2.02778| -4.44111| -4.51025|     1|
|4.38541E-6|  2.02778| -2.03551| -4.51025|     2|
|4.38541E-6|  2.02778| -4.44111| -4.51025|     3|
|   2.40175|  2.02778| -4.44111|  2.00455|     4|
|4.38541E-6|-0.368683| -4.44111|  2.00455|     5|
|4.38541E-6|-0.368683| -2.03551| -4.51025|     6|
|   2.40175|  2.02778| -4.44111| -4.51025|     7|
|4.38541E-6|-0.368683| -2.03551| -4.51025|     8|
|4.38541E-6|  2.02778| -4.44111| -4.51025|     9|
|4.38541E-6|  2.02778| -2.03551| -4.51025|    10|
|4.38541E-6|-0.368683| -4.44111| -4.51025|    11|
|4.38541E-6|  2.02778| -2.03551| -4.51025|    12|
|4.38541E-6|  2.02778| -2.03551| -4.51025|    13|
|4.38541E-6|  2.02778| -2.03551| -4.51025|    14|
|4.38541E-6|-0.368683| -4.44111| -4.51025|    15|
|4.38541E-6|-0.368683| -2.03551| -4.51025|    16|
|4.38541E-6|  2.02778| -2.03551| -4.51025|    17|
|4.38541E-6|  2.02778| -4.44111| -4.51025|    18|
|4.38541E-6|  2.02778| -4.44111| -4.51025|    19|
|4.38541E-6|-0.368683| -4.44111| -4.51025|    20|
+----------+---------+---------+---------+------+
only showing top 20 rows


scala>

spark-ods's People

Contributors

kurodamasayoshi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.