Skip to content

Commit

Permalink
24.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonny Dixon committed May 22, 2023
1 parent 91ffc18 commit 4b9cca2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
Binary file modified dremio-sybasearp-plugin.jar
Binary file not shown.
10 changes: 6 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@
limitations under the License.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>

<groupId>com.dremio.plugin</groupId>
<version>19.1.0</version>
<version>24.0.0</version>
<artifactId>dremio-sybasearp-plugin</artifactId>
<name>Dremio Sybase ARP Community Connector</name>

<properties>
<version.dremio>19.1.0-202111160130570172-0ee00450</version.dremio>
<version.dremio>24.0.0-202302100528110223-3a169b7c</version.dremio>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/**
* Configuration for Sybase sources.
*/
@SourceType(value = "SYBASEARP", label = "Sybase", uiConfig = "sybasearp-layout.json", externalQuerySupported = true)
@SourceType(value = "SYBASEARP", label = "Sybase", uiConfig = "sybasearp-layout.json", externalQuerySupported = true, previewEngineRequired = true)
public class SybaseConf extends AbstractArpConf<SybaseConf> {
private static final String ARP_FILENAME = "arp/implementation/sybase-arp.yaml";
private static final ArpDialect ARP_DIALECT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.apache.calcite.sql.SqlLiteral;
import org.apache.calcite.sql.SqlNodeList;
import org.apache.calcite.sql.SqlWriter;
import org.apache.calcite.sql.SqlOperator;
import org.apache.calcite.sql.parser.SqlParserPos;
import org.apache.calcite.sql.SqlAbstractDateTimeLiteral;
import com.dremio.exec.store.jdbc.dialect.arp.ArpDialect;
Expand Down Expand Up @@ -71,22 +72,23 @@ public void unparseDateTimeLiteral(SqlWriter writer,
}

@Override
public void unparseCall(final SqlWriter writer, final SqlCall call, final int leftPrec, final int rightPrec) {
// Transform SqlSelect nodes that have a fetch node to be SqlSelect nodes with a TOP and no fetch.
if (call instanceof SqlSelect) {
final SqlSelect select = (SqlSelect) call;
public void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) {
final SqlOperator op = call.getOperator();

if (call instanceof SqlSelect) {
// Transform SqlSelect nodes that have a fetch node without offset to be
// SqlSelect nodes with a TOP and no fetch.
if (null != select.getFetch()
&& (null == select.getOffset() || 0 == ((SqlLiteral) select.getOffset()).getValueAs(Long.class))) {
final SqlSelect select = (SqlSelect) call;

if (select.getFetch() != null
&& (select.getOffset() == null || ((SqlLiteral) select.getOffset()).getValueAs(Long.class) == 0)) {
final SqlNodeList keywords = new SqlNodeList(SqlParserPos.ZERO);

// Add the DISTINCT or ALL keywords if the original Select had either. (Only can have one of these).
// These must go before TOP.
if (null != select.getModifierNode(SqlSelectKeyword.DISTINCT)) {
if (select.getModifierNode(SqlSelectKeyword.DISTINCT) != null) {
keywords.add(select.getModifierNode(SqlSelectKeyword.DISTINCT));
} else if (null != select.getModifierNode(SqlSelectKeyword.ALL)) {
} else if (select.getModifierNode(SqlSelectKeyword.ALL) != null) {
keywords.add(select.getModifierNode(SqlSelectKeyword.ALL));
}

Expand All @@ -103,6 +105,7 @@ public void unparseCall(final SqlWriter writer, final SqlCall call, final int le
select.getGroup(),
select.getHaving(),
select.getWindowList(),
select.getQualify(),
select.getOrderList(),
null,
null,
Expand Down

0 comments on commit 4b9cca2

Please sign in to comment.