CREATE DATABASE myvdb;
USE DATABASE myvdb;
CREATE FOREIGN DATA WRAPPER "hive-delegator" TYPE delegator OPTIONS (delegateName 'hive', supportsOrderBy 'false');
CREATE SERVER source FOREIGN DATA WRAPPER "hive-delegator" OPTIONS ("resource-name" 'java:hive-ds');
CREATE SCHEMA mymodel SERVER source;
SET SCHEMA mymodel;
IMPORT FROM SERVER source INTO mymodel;
Delegator translators
You can use the delegator translator, which is available in the core Teiid Spring Boot installation, to modify the capabilities of a existing translator.
Often times for debugging purposes, or in special situations, you might want to turn certain capabilities of a translator on or off.
For example, say that the latest version of a Hive database supports the ORDER BY
construct, but the current Teiid Spring Boot version of the Hive translator does not.
You could use the delegator translator to enable ORDER BY
compatibility without actually writing any code.
Similarly, you could do the reverse, and turn off certain capabilities to produce a better plan.
To use the delegator translator, you must define it in the DDL.
The following example shows how to override the "hive" translator and turn off the ORDER BY
capability.
For more information about the translator capabilities that you can override by using execution properties, see Translator_Capabilities in the Translator Development Guide.
The preceding example shows how you might modify the default ORDER BY
compatibility of the Hive translator.