Skip to content
forked from linkedin/coral

Coral is a translation, analysis, and query rewrite engine for SQL and other relational languages.

License

Notifications You must be signed in to change notification settings

khaitranq/coral

 
 

Repository files navigation

Coral

Coral is a library for analyzing, processing, and rewriting views defined in the Hive Metastore, and sharing them across multiple execution engines. It performs SQL translations to enable views expressed in HiveQL (and potentially other languages) to be accessible in engines such as Presto, Apache Spark, Apache Pig, or Java Streaming API with Apache Beam. Coral not only translates view definitions between different SQL/non-SQL dialects, but also rewrites expressions to produce semantically equivalent ones, taking into account the semantics of the target language or engine. For example, it automatically composes new built-in expressions that are equivalent to each built-in expression in the source view definition. Additionally, it integrates with Transport UDFs to enable translating and executing user-defined functions (UDFs) across Hive, Presto, Spark, and Pig. Coral is under active development. Currently, we are looking into expanding the set of input view language APIs beyond HiveQL, and implementing query rewrite algorithms for data governance and query optimization.

Modules

Coral consists of following modules:

  • Coral-Hive: Converts definitions of Hive views with UDFs to equivalent view logical plan.
  • Coral-Presto: Converts view logical plan to Presto SQL.
  • Coral-Spark: Converts view logical plan to Spark SQL.
  • Coral-Pig: Converts view logical plan to Pig-latin.
  • Coral-Schema: Derives Avro schema of view using view logical plan and input Avro schemas of base tables.
  • Coral-Spark-Plan: Converts Spark plan strings to equivalent logical plan (in progress).
  • Coral-Beam: Convert view logical plan to Beam Java API streaming code
  • Coral-Beam-Runtime: runtime module to support Coral-Beam

How to Build

Clone the repository:

git clone https://github.com/linkedin/coral.git

Build:

./gradlew build

Contributing

The project is under active development and we welcome contributions of different forms. Please see the Contribution Agreement.

Resources

About

Coral is a translation, analysis, and query rewrite engine for SQL and other relational languages.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%