Skip to content

Commit 89efedf

Browse files
* #154: Removed toSimpleSql() method and its implementation because i… (#155)
* #154: Removed toSimpleSql() method and its implementation because it was not used. Co-authored-by: Sebastian Bär <sebastian.baer@exasol.com>
1 parent 4c007b8 commit 89efedf

File tree

78 files changed

+78
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+78
-630
lines changed

doc/changes/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes
22

3-
* [11.1.0](changes-11.1.0.md)
3+
* [12.0.0](changes-12.0.0.md)
44
* [11.0.0](changes-11.0.0.md)
55
* [10.1.0](changes-10.1.0.md)

doc/changes/changes-11.1.0.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

doc/changes/changes-12.0.0.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Virtual Schema Common Java 12.0.0, released 2020-09-29
2+
3+
Code name: New capabilities, refactored API
4+
5+
## Summary
6+
7+
In this release we added the following capabilities:
8+
`FN_BIT_LROTATE`, `FN_BIT_RROTATE`, `FN_BIT_LSHIFT`, `FN_BIT_RSHIFT,` `FN_FROM_POSIX_TIME`, `FN_HOUR`, `FN_INITCAP`, `FN_AGG_EVERY`, `FN_AGG_SOME`, `FN_AGG_MUL_DISTINCT`.
9+
10+
We have removed the capabilities that are not used in the API: `FN_HASH_SHA`
11+
12+
## Features / Enhancements
13+
14+
* #147: Added new capabilities.
15+
16+
## Documentation
17+
18+
* #149: Moved the API documentation to this repository.
19+
20+
## Refactoring
21+
22+
* #152: Refactored the module according to the changes in the API:
23+
- removed usage of `numArgs` field in scalar function definitions;
24+
- removed usage of `variableInputArgs` field in scalar function definitions;
25+
- removed usage of prefix and infix fields in scalar function definitions;
26+
* #154: Removed `toSimpleSql()` method and its implementation because it was not used.
27+
28+
## Dependency updates
29+
30+
* Updated org.junit.jupiter:junit-jupiter:jar:5.6.2 to version 5.7.0
31+
* Updated org.mockito:mockito-junit-jupiter:jar:3.4.4 to version 3.5.13
32+
* Updated nl.jqno.equalsverifier:equalsverifier:jar:3.4.1 to version 3.4.3

doc/development/api/capabilities_list.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ Here you can find a list of available Virtual Schema capabilities.
115115
- FN_FROM_POSIX_TIME
116116
- FN_GREATEST
117117
- FN_HASH_MD5
118-
- FN_HASH_SHA
119118
- FN_HASH_SHA1
120119
- FN_HASH_SHA256
121120
- FN_HASH_SHA512

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
<dependency>
8989
<groupId>org.junit.jupiter</groupId>
9090
<artifactId>junit-jupiter</artifactId>
91-
<version>5.6.2</version>
91+
<version>5.7.0</version>
9292
<scope>test</scope>
9393
</dependency>
9494
<dependency>
9595
<groupId>org.mockito</groupId>
9696
<artifactId>mockito-junit-jupiter</artifactId>
97-
<version>3.4.4</version>
97+
<version>3.5.13</version>
9898
<scope>test</scope>
9999
</dependency>
100100
<dependency>
@@ -106,7 +106,7 @@
106106
<dependency>
107107
<groupId>nl.jqno.equalsverifier</groupId>
108108
<artifactId>equalsverifier</artifactId>
109-
<version>3.4.1</version>
109+
<version>3.4.3</version>
110110
<scope>test</scope>
111111
</dependency>
112112
</dependencies>

src/main/java/com/exasol/adapter/sql/AbstractSqlBinaryEquality.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@ public SqlNode getLeft() {
2323
public SqlNode getRight() {
2424
return this.right;
2525
}
26-
27-
public String toSimpleSql(final String equalityExpression) {
28-
return this.left.toSimpleSql() + equalityExpression + this.right.toSimpleSql();
29-
}
30-
}
26+
}

src/main/java/com/exasol/adapter/sql/SqlColumn.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ public String getTableAlias() {
4848
return this.tableAlias;
4949
}
5050

51-
@Override
52-
public String toSimpleSql() {
53-
return "\"" + this.metadata.getName().replace("\"", "\"\"") + "\"";
54-
}
55-
5651
@Override
5752
public SqlNodeType getType() {
5853
return SqlNodeType.COLUMN;
@@ -68,4 +63,4 @@ public String toString() {
6863
return "SqlColumn{" + "id=" + this.id + ", metadata=" + this.metadata + ", tableName='" + this.tableName + '\''
6964
+ ", tableAlias='" + this.tableAlias + '\'' + '}';
7065
}
71-
}
66+
}

src/main/java/com/exasol/adapter/sql/SqlFunctionAggregate.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.exasol.adapter.AdapterException;
44

5-
import java.util.ArrayList;
65
import java.util.Collections;
76
import java.util.List;
87

@@ -50,23 +49,6 @@ public boolean hasDistinct() {
5049
return distinct;
5150
}
5251

53-
@Override
54-
public String toSimpleSql() {
55-
final List<String> argumentsSql = new ArrayList<>();
56-
for (final SqlNode node : arguments) {
57-
argumentsSql.add(node.toSimpleSql());
58-
}
59-
if (argumentsSql.isEmpty()) {
60-
assert getFunctionName().equalsIgnoreCase("count");
61-
argumentsSql.add("*");
62-
}
63-
String distinctSql = "";
64-
if (distinct) {
65-
distinctSql = "DISTINCT ";
66-
}
67-
return getFunctionName() + "(" + distinctSql + String.join(", ", argumentsSql) + ")";
68-
}
69-
7052
@Override
7153
public SqlNodeType getType() {
7254
return SqlNodeType.FUNCTION_AGGREGATE;
@@ -76,4 +58,4 @@ public SqlNodeType getType() {
7658
public <R> R accept(final SqlNodeVisitor<R> visitor) throws AdapterException {
7759
return visitor.visit(this);
7860
}
79-
}
61+
}

src/main/java/com/exasol/adapter/sql/SqlFunctionAggregateGroupConcat.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,6 @@ public boolean hasDistinct() {
6262
return this.distinct;
6363
}
6464

65-
@Override
66-
public String toSimpleSql() {
67-
String distinctSql = "";
68-
if (this.distinct) {
69-
distinctSql = "DISTINCT ";
70-
}
71-
final StringBuilder builder = new StringBuilder();
72-
builder.append(getFunctionName());
73-
builder.append("(");
74-
builder.append(distinctSql);
75-
assert this.arguments != null;
76-
assert this.arguments.size() == 1 && this.arguments.get(0) != null;
77-
builder.append(this.arguments.get(0).toSimpleSql());
78-
if (this.orderBy != null) {
79-
builder.append(" ");
80-
builder.append(this.orderBy.toSimpleSql());
81-
}
82-
if (this.separator != null) {
83-
builder.append(" SEPARATOR ");
84-
builder.append("'");
85-
builder.append(this.separator);
86-
builder.append("'");
87-
}
88-
builder.append(")");
89-
return builder.toString();
90-
}
91-
9265
@Override
9366
public SqlNodeType getType() {
9467
return SqlNodeType.FUNCTION_AGGREGATE_GROUP_CONCAT;

src/main/java/com/exasol/adapter/sql/SqlFunctionScalar.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ public String getFunctionName() {
4242
return this.function.name();
4343
}
4444

45-
@Override
46-
public String toSimpleSql() {
47-
return getFunctionName();
48-
}
49-
5045
@Override
5146
public SqlNodeType getType() {
5247
return SqlNodeType.FUNCTION_SCALAR;
@@ -56,4 +51,4 @@ public SqlNodeType getType() {
5651
public <R> R accept(final SqlNodeVisitor<R> visitor) throws AdapterException {
5752
return visitor.visit(this);
5853
}
59-
}
54+
}

0 commit comments

Comments
 (0)