SAP Vora Developer Guide Content
Total Page:16
File Type:pdf, Size:1020Kb
PUBLIC SAP Vora 2.1 Document Version: 1.2 – 2018-04-23 SAP Vora Developer Guide Content 1 Introduction to SAP Vora......................................................6 1.1 SAP Vora Architecture..........................................................9 Component Overview....................................................... 9 1.2 SAP Vora System Management Architecture......................................... 11 2 Getting Started with Application Development.....................................12 2.1 Using the SAP Vora Spark Extension...............................................13 Configuring Authentication for SAP Vora......................................... 13 Use SAP Vora Through the Spark Shell...........................................14 Setting Up and Running an SAP Vora Spark Project..................................15 Accessing Data Sources.....................................................15 Executing Queries......................................................... 16 Spark Examples...........................................................16 2.2 Accessing SAP Vora Through the Thrift Server........................................19 2.3 Accessing SAP Vora from SAP HANA Through SDA and Vora ODBC........................ 20 3 Working with Relational Tables and Views.........................................23 3.1 Creating Tables in the Relational Engines............................................24 3.2 Creating Partitioned Tables in the Relational Engines...................................25 3.3 SAP Vora SQL Reference.......................................................25 Notation................................................................26 Introduction to SQL........................................................26 Data Types..............................................................28 Data Definition Language (DDL)...............................................32 Data Manipulation Language (DML).............................................53 SQL Query Syntax (SELECT)..................................................55 SQL Functions and Operators.................................................56 System Views............................................................68 4 Working with Graphs, Documents, and Time Series................................. 76 4.1 Processing Graph Data........................................................77 SAP Vora Graph Data Model..................................................77 Linked CSV Files.......................................................... 78 JSG Files................................................................82 Creating Graphs.......................................................... 83 Dropping Graphs..........................................................84 Accessing Graphs as Tables..................................................84 Graph Query Language..................................................... 85 SAP Vora Developer Guide 2 PUBLIC Content Graph Query Structure......................................................86 Graph Functions..........................................................93 Graph Type Information.....................................................97 4.2 Analyzing Time Series Data.....................................................98 Data Definition Language (DDL)...............................................98 Data Manipulation Language (DML)............................................105 Data Query Language (DQL).................................................105 4.3 Working with Collections (Document Store).........................................116 Documents and Collections..................................................117 Creating Collections.......................................................118 Dot Notation............................................................120 SELECT Clauses..........................................................120 Expressions.............................................................125 Mathematical Expressions.................................................. 128 Aggregation.............................................................128 Time-Related Features.....................................................130 5 Partitioning Tables.........................................................135 5.1 Partition Function...........................................................135 RANGE Partitioning....................................................... 136 HASH Partitioning........................................................ 136 BLOCK Partitioning........................................................137 5.2 Partition Scheme............................................................137 5.3 Engine Compatibility Overview..................................................138 6 SAP Vora Integration with Spark 2............................................. 139 6.1 Clients...................................................................139 6.2 SAP Vora Data Source........................................................140 Configuring the SAP Vora Data Source..........................................141 Registering Tables.........................................................141 Querying Ad-hoc Views.....................................................142 Partitioning Result Sets.....................................................143 Inserting Data into SAP Vora.................................................144 SAP Vora Data Source Parameters.............................................145 Data Type Mappings.......................................................145 6.3 SAP HANA Data Source.......................................................146 Configuring the SAP HANA Data Source.........................................147 Registering Tables........................................................ 147 Querying Ad-hoc Views.....................................................148 Partitioning Result Sets.....................................................149 Inserting Data into SAP HANA................................................150 Using SAP HANA Secure Store...............................................150 SAP Vora Developer Guide Content PUBLIC 3 SAP HANA Data Source Parameters............................................151 Data Type Mappings.......................................................152 7 Accessing SAP Vora from SAP HANA ...........................................153 7.1 Enable the SAP HANA Wire for Smart Data Access....................................154 7.2 Create an SAP Vora Remote Source.............................................. 154 7.3 Create Virtual Tables.........................................................156 7.4 Data Type Restrictions........................................................158 7.5 SQL Queries...............................................................159 Executing Remote Queries.................................................. 159 Reroute Stored Procedures..................................................160 8 Using Hierarchies..........................................................162 8.1 Creating Adjacency-List Hierarchies..............................................162 8.2 Hierarchy Example (h_src).....................................................163 8.3 Using Hierarchies with Materialized Views..........................................165 8.4 Hierarchy UDFs.............................................................167 9 Currency Conversion........................................................168 10 Working with the SAP Vora Tools.............................................. 169 10.1 View Data using the Data Preview................................................ 171 10.2 Execute SQL Scripts Using the SQL Editor..........................................171 10.3 SQL Editor Keyboard Shortcuts..................................................173 11 Data Modeling in SAP Vora................................................... 175 11.1 Create Schemas............................................................176 11.2 Create Partition Schemes......................................................177 11.3 Creating Tables in SAP Vora....................................................178 Create Tables in the SAP Vora Relational Engine................................... 179 Create Tables for Time Series Data.............................................184 Create Tables on the Disk...................................................189 Create Collections........................................................194 Create Graphs...........................................................198 11.4 Creating Views in SAP Vora....................................................202 Create Views............................................................202 Create Views with Collections................................................210 Create Views with Graphs...................................................212 11.5 Preview Output of Views.......................................................214 11.6 Visualizing and Analyzing the Data ...............................................216 Analyze Data in Tables..................................................... 216 Analyze Time Series Data...................................................217 Analyze Graph Data.......................................................219 SAP Vora Developer Guide 4 PUBLIC Content 11.7 Additional Functionality for Views................................................221 Creating Hierarchies.......................................................221