项目作者: xu-hao

项目描述 :
A semantically unified SQL and NoSQL query and update system
高级语言: Haskell
项目地址: git://github.com/xu-hao/QueryArrow.git
创建时间: 2015-06-25T17:56:04Z
项目社区:https://github.com/xu-hao/QueryArrow

开源协议:BSD 3-Clause "New" or "Revised" License

下载


QueryArrow

Resources

Hao Xu, Ben Keller, Antoine de Torcy, Jason Coposky (2016) QueryArrow: Bidirectional Integration of Multiple Metadata Sources. 8th iRODS User Group Meeting, University of North Carolina at Chapel Hill. June 2016.

Slides: https://irods.org/uploads/2016/06/queryarrow2_Hao-Xu_DICE_iRODS-UGM-2016.pdf
https://irods.org/uploads/2017/Xu-RENCI-QueryArrow-slides.pdf

Technical Report: https://irods.org/uploads/2015/01/xu-queryarrow-2016.pdf

Paper: https://irods.org/uploads/2017/Xu-RENCI-QueryArrow-paper.pdf

Specification: https://github.com/xu-hao/CertifiedQueryArrow

Introduction

QueryArrow is motivated by the following applications: bidirectional metadata integration from different metadata sources, metadata policies, metadata migration from different databases, metadata indexing.

QueryArrow provides a systematic solution to shared namespace and unshared namespace federation of metadata. In particular, QueryArrow allows querying multiple multiple data sources including NoSQL databases, and updating data sources. For data sources that support two-phase commit, QueryArrow also supports distributed transactions. QueryArrow also enables poly-fill for features that the underlying database does not support.

A QueryArrow instance includes a QueryArrow Service and QueryArrow plugins (QAPs). Each plugin provides interface with one data store.
The queries are issued from the client in the QueryArrow Language (QAL). QAL is a unified query and update language for SQL and NoSQL databases.

Build docker image

build bases

  1. cd docker/build
  2. docker build -t queryarrow-stack-build:0.1.0 .
  1. cd docker/run
  2. docker build -t queryarrow-stack-run:0.1.0 .

If you use customized bases from Internet, then

  1. stack docker pull

build

  1. stack build

create image

  1. stack image container

How to build (deprecated)

Ubuntu 16.04 and CentOS 7

Install GHC 8.0.2

From source:

https://www.haskell.org/ghc/download_ghc_8_0_2#sources

Find out where ghc is installed.

If built from source, it is <prefix>/lib/ghc-8.0.2/. Default <prefix> is /usr/local.

Install Stack

Follow the instructions on this page:

https://docs.haskellstack.org

If you install from system repo, make sure you run

  1. stack upgrade

Install Packages

On Ubuntu

  1. apt-get install postgresql-server-dev-all libsqlite3-dev -y

On CentOS

  1. yum install postgresql-devel sqlite3-devel -y

Build QueryArrow

  1. git clone http://github.com/xu-hao/QueryArrow
  2. cd QueryArrow
  3. stack build

Create QueryArrow Package

  1. cd ..

Make a new directory

  1. mkdir build
  2. cd build
  3. ../QueryArrow/find_dependencies.sh ../QueryArrow
  4. cpack --config CPackConfig.cmake

Install QueryArrow Package

On Ubuntu

  1. dpkg -i queryarrow-0.2-Linux-amd64.deb

On CentOS

  1. yum install queryarrow-0.2-Linux-amd64.rpm

QueryArrow Configuration

By default QueryArrow Configuration files are stored in the /etc/QueryArrow/tdb-plugin-gen-abs.yaml file.

An example is

  1. db_plugin:
  2. qap_name: cache
  3. catalog_database_type: Cache
  4. db_config:
  5. max_cc: 1024
  6. cache_db_plugin:
  7. qap_name: trans
  8. catalog_database_type: Translation
  9. db_config:
  10. rewriting_file_path: "../QueryArrow-gen/rewriting-plugin-gen.rules"
  11. include_file_path:
  12. - "../QueryArrow-gen"
  13. trans_db_plugin:
  14. qap_name: sum
  15. catalog_database_type: Sum
  16. db_config:
  17. summands:
  18. - qap_name: ICAT
  19. catalog_database_type: SQL/HDBC/PostgreSQL
  20. db_config:
  21. db_port: 5432
  22. db_name: ICAT
  23. db_password: testpassword
  24. db_host: localhost
  25. db_username: irods
  26. db_predicates: "../QueryArrow-gen/gen/ICATGen"
  27. db_namespace: ICAT
  28. db_sql_mapping: "../QueryArrow-gen/gen/SQL/ICATGen"
  29. - qap_name: ''
  30. catalog_database_type: FileSystem
  31. db_config:
  32. fs_port: 0
  33. db_namespace: FileSystem
  34. fs_host: ''
  35. fs_root: "/tmp"
  36. fs_hostmap:
  37. - - ''
  38. - 0
  39. - "/tmp"
  40. - qap_name: ''
  41. catalog_database_type: InMemory/BuiltIn
  42. db_config:
  43. db_namespace: BuiltIn
  44. servers:
  45. - server_protocol: service/tcp
  46. server_config:
  47. tcp_server_addr: "*"
  48. tcp_server_port: 12345

QueryArrow Plugin

Currently, the implemented QAPs include

Name Description db_config
Sum aggregation summands, db_namespace
Translation policy support rewriting_file_path, include_file_path,trans_db_plugin
Cache caching max_cc, cache_db_plugin
Remote/TCP remoting db_host, db_port
FileSystem interfacing with file system fs_host, fs_port, fs_root, fs_hostmap, db_namespace
ElasticSearch/ElasticSearch interfacing with ElasticSearch db_name, db_namespace, db_predicates, db_sql_mapping, db_host, db_port, db_username, db_password
Cypher/Neo4j interfacing with Neo4j db_namespace, db_predicates, db_sql_mapping, db_host, db_port, db_username, db_password
SQL/HDBC/PostgreSQL interfacing with Postgres db_name, db_namespace, db_predicates, db_sql_mapping, db_host, db_port, db_username, db_password
SQL/HDBC/SQLite3 interfacing with SQLite3 db_file_path, db_namespace, db_predicates, db_sql_mapping
SQL/HDBC/CockroachDB interfacing with CockroachDB db_name, db_namespace, db_predicates, db_sql_mapping, db_host, db_port, db_username, db_password
Include include other config files include
InMemory/StateMap in-memory mutable map db_namespace,predicate_name,db_map
InMemory/Map in-memory immutable map db_namespace,predicate_name,db_map
InMemory/BuiltIn built-in predicates: like_regex, not_like_regex, eq, ne, le, ge, lt, gt, concat, substr, strlen, add, sub, mul, div, mod, exp, like, not_like, in, replace, regex_replace, sleep, encode db_namespace

QueryArrow CLI

QueryArrow provides a CLI command QueryArrow.

QueryArrow Server

QueryArrow provides server protocols. The service protocol is used for clients to communicate with QueryArrow. The remote protocol is used by the Remote QAP. The file system protocol is used by the FileSystem QAP.

unix domain socket tcp socket http
service implemented implemented implemented
remote implemented implemented
file system implemented
Service server_config
service/tcp, remote/tcp tcp_server_addr, tcp_server_port
service/http http_server_port
service/unix domain socket, remote/unix domain socket uds_server_addr
file system/tcp fs_server_port, fs_server_root, fs_server_addr

The command for starting the server is QueryArrowServer.

iRODS Database Plugin

In addition to running QueryArrow as a standalone service, QueryArrow provides an iRODS database plugin. To build it, follow instructions for building iRODS database plugins.