-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wrangler sql execution initial setup
- Loading branch information
1 parent
5790e4b
commit c177602
Showing
5 changed files
with
228 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
wrangler-api/src/main/java/io/cdap/wrangler/api/DirectiveRelationalTransform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright © 2023 Cask Data, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package io.cdap.wrangler.api; | ||
|
||
import io.cdap.cdap.etl.api.relational.InvalidRelation; | ||
import io.cdap.cdap.etl.api.relational.LinearRelationalTransform; | ||
import io.cdap.cdap.etl.api.relational.Relation; | ||
import io.cdap.cdap.etl.api.relational.RelationalTranformContext; | ||
|
||
/** | ||
* {@link DirectiveRelationalTransform} provides relational transform support for | ||
* wrangler directives. | ||
*/ | ||
public interface DirectiveRelationalTransform extends LinearRelationalTransform { | ||
|
||
/** | ||
* Implementation of linear relational transform for each supported directive. | ||
* | ||
* @param relationalTranformContext transformation context with engine, input and output parameters | ||
* @param relation input relation upon which the transformation is applied. | ||
* @return transformed relation as the output relation. By default, returns an Invalid relation | ||
* for unsupported directives. | ||
*/ | ||
default Relation transform(RelationalTranformContext relationalTranformContext, | ||
Relation relation) { | ||
return new InvalidRelation("SQL execution for the directive is currently not supported."); | ||
} | ||
|
||
/** | ||
* Indicates whether the directive is supported by relational transformation or not. | ||
* | ||
* @return boolean value for the directive SQL support. | ||
* By default, returns false, indicating that the directive is currently not supported. | ||
*/ | ||
default boolean isSQLSupported() { | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.