Skip to content

Commit 4b9cca2

Browse files
author
Jonny Dixon
committed
24.0.0
1 parent 91ffc18 commit 4b9cca2

4 files changed

Lines changed: 18 additions & 13 deletions

File tree

dremio-sybasearp-plugin.jar

51 Bytes
Binary file not shown.

pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@
1616
limitations under the License.
1717
1818
-->
19-
<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"
19+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
20+
http://maven.apache.org/xsd/maven-4.0.0.xsd"
21+
xmlns="http://maven.apache.org/POM/4.0.0"
2022
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
21-
<modelVersion>4.0.0</modelVersion>
23+
<modelVersion>4.0.0</modelVersion>
2224

2325
<groupId>com.dremio.plugin</groupId>
24-
<version>19.1.0</version>
26+
<version>24.0.0</version>
2527
<artifactId>dremio-sybasearp-plugin</artifactId>
2628
<name>Dremio Sybase ARP Community Connector</name>
2729

2830
<properties>
29-
<version.dremio>19.1.0-202111160130570172-0ee00450</version.dremio>
31+
<version.dremio>24.0.0-202302100528110223-3a169b7c</version.dremio>
3032
</properties>
3133

3234
<dependencies>

src/main/java/com/dremio/exec/store/jdbc/conf/SybaseConf.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/**
4545
* Configuration for Sybase sources.
4646
*/
47-
@SourceType(value = "SYBASEARP", label = "Sybase", uiConfig = "sybasearp-layout.json", externalQuerySupported = true)
47+
@SourceType(value = "SYBASEARP", label = "Sybase", uiConfig = "sybasearp-layout.json", externalQuerySupported = true, previewEngineRequired = true)
4848
public class SybaseConf extends AbstractArpConf<SybaseConf> {
4949
private static final String ARP_FILENAME = "arp/implementation/sybase-arp.yaml";
5050
private static final ArpDialect ARP_DIALECT =

src/main/java/com/dremio/exec/store/jdbc/dialect/SybaseDialect.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.apache.calcite.sql.SqlLiteral;
1313
import org.apache.calcite.sql.SqlNodeList;
1414
import org.apache.calcite.sql.SqlWriter;
15+
import org.apache.calcite.sql.SqlOperator;
1516
import org.apache.calcite.sql.parser.SqlParserPos;
1617
import org.apache.calcite.sql.SqlAbstractDateTimeLiteral;
1718
import com.dremio.exec.store.jdbc.dialect.arp.ArpDialect;
@@ -71,22 +72,23 @@ public void unparseDateTimeLiteral(SqlWriter writer,
7172
}
7273

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

78+
if (call instanceof SqlSelect) {
7979
// Transform SqlSelect nodes that have a fetch node without offset to be
8080
// SqlSelect nodes with a TOP and no fetch.
81-
if (null != select.getFetch()
82-
&& (null == select.getOffset() || 0 == ((SqlLiteral) select.getOffset()).getValueAs(Long.class))) {
81+
final SqlSelect select = (SqlSelect) call;
82+
83+
if (select.getFetch() != null
84+
&& (select.getOffset() == null || ((SqlLiteral) select.getOffset()).getValueAs(Long.class) == 0)) {
8385
final SqlNodeList keywords = new SqlNodeList(SqlParserPos.ZERO);
8486

8587
// Add the DISTINCT or ALL keywords if the original Select had either. (Only can have one of these).
8688
// These must go before TOP.
87-
if (null != select.getModifierNode(SqlSelectKeyword.DISTINCT)) {
89+
if (select.getModifierNode(SqlSelectKeyword.DISTINCT) != null) {
8890
keywords.add(select.getModifierNode(SqlSelectKeyword.DISTINCT));
89-
} else if (null != select.getModifierNode(SqlSelectKeyword.ALL)) {
91+
} else if (select.getModifierNode(SqlSelectKeyword.ALL) != null) {
9092
keywords.add(select.getModifierNode(SqlSelectKeyword.ALL));
9193
}
9294

@@ -103,6 +105,7 @@ public void unparseCall(final SqlWriter writer, final SqlCall call, final int le
103105
select.getGroup(),
104106
select.getHaving(),
105107
select.getWindowList(),
108+
select.getQualify(),
106109
select.getOrderList(),
107110
null,
108111
null,

0 commit comments

Comments
 (0)