Coder Social home page Coder Social logo

test-spark-datatypes's Introduction

SparkSQL --> XML Schema datatypes conversion in OntopSpark


SparkSQL reference : https://spark.apache.org/docs/latest/sql-ref-datatypes.html

W3C reccomended mappings : https://www.w3.org/2001/sw/rdb2rdf/wiki/Mapping_SQL_datatypes_to_XML_Schema_datatypes


Spark datatype SparkSQL name W3C reccomandation ONTOP default OntopSpark
BooleanType BOOLEAN xsd:boolean xsd:boolean
ByteType BYTE, TINYINT xsd:integer or subtype xsd:integer xsd:byte
ShortType SHORT, SMALLINT xsd:integer or subtype xsd:integer xsd:short
IntegerType INT, INTEGER xsd:integer or subtype xsd:integer xsd:int
LongType LONG, BIGINT xsd:integer or subtype xsd:integer xsd:long
FloatType FLOAT, REAL xsd:float or xsd:double xsd:double xsd:float
DoubleType DOUBLE xsd:double xsd:double
DateType DATE xsd:date xsd:date
TimestampType TIMESTAMP xsd:dateTime xsd:dateTime
StringType STRING xsd:string xsd:string
BinaryType BINARY xsd:hexBinary or xsd:base64Binary xsd:hexBinary
DecimalType DECIMAL, DEC, NUMERIC xsd:decimal xsd:decimal

Running the test

  1. Build and run Apache Spark
foo@bar:~$ sudo ./docker-build.sh
foo@bar:~$ sudo docker-compose -f docker-compose-spark.yml up
  1. Wait Apache Spark complete startup, then run OntopSpark in another console window
foo@bar:~$ sudo docker-compose -f docker-compose-ontop.yml up
  1. Connect to localhost:8080

  2. Execute the query, and check the datatypes

PREFIX : <http://www.semanticweb.org/spark-datatypes-test#>

SELECT * WHERE {
  ?sub ?pred ?obj .
}

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.