presto_sql_parser 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/README.md +32 -0
- data/lib/presto_sql_parser/support_process.rb +3 -4
- data/lib/presto_sql_parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 914db19484a83d4dec4785bd05bccb7fca4f34fea03a9f01bc132d38cd2857e0
|
4
|
+
data.tar.gz: 79ba29657fec84702680fc96a413a7a90f618570c80a8033147185b7f2d57cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3a5df1ebc7deef137a3e6162f78216a4a96c54e4df3ec3e78234c62a04a313bbb4b0389d93f84ce17e38fa9e87b0657ce6937cb6a1ebf3e7af5716d3ceaed50
|
7
|
+
data.tar.gz: 270e33d525810824561f35b4e059aed05d8d636b737ba1a5d8fc12c2a39f6283dc93f7a6346988693b8de2af86d65d1a9642a35a2ecd3f6467687373dd8ac769
|
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -24,6 +24,38 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
`java` command must be available because this PrestoSqlParser needs to use Presto's jar file.
|
26
26
|
|
27
|
+
If `java` is not available, such as in a pre-built Docker container, you would install java using following script:
|
28
|
+
|
29
|
+
```bash
|
30
|
+
if [[ ! -d ~/java/jre_11.0.4_11 ]]; then
|
31
|
+
mkdir -p ~/java
|
32
|
+
curl -L "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jre_x64_linux_hotspot_11.0.4_11.tar.gz" | tar zx -C ~/java
|
33
|
+
mv ~/java/jdk-11.0.4+11-jre ~/java/jre_11.0.4_11
|
34
|
+
fi
|
35
|
+
echo 'export PATH=$HOME/java/jre_11.0.4_11/bin:$PATH' >> ~/.bashrc
|
36
|
+
```
|
37
|
+
|
38
|
+
On Circle CI 2.0, you can add following configuration to `steps` section:
|
39
|
+
|
40
|
+
```yaml
|
41
|
+
- type: cache-restore
|
42
|
+
key: jre_11.0.4_11
|
43
|
+
- run:
|
44
|
+
name: Install java
|
45
|
+
command: |
|
46
|
+
set -xe
|
47
|
+
if [[ ! -d ~/java/jre_11.0.4_11 ]]; then
|
48
|
+
mkdir -p ~/java
|
49
|
+
curl -L "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jre_x64_linux_hotspot_11.0.4_11.tar.gz" | tar zx -C ~/java
|
50
|
+
mv ~/java/jdk-11.0.4+11-jre ~/java/jre_11.0.4_11
|
51
|
+
fi
|
52
|
+
echo 'export PATH=$HOME/java/jre_11.0.4_11/bin:$PATH' >> $BASH_ENV
|
53
|
+
- type: cache-save
|
54
|
+
key: jre_11.04_11
|
55
|
+
paths:
|
56
|
+
- ~/java
|
57
|
+
```
|
58
|
+
|
27
59
|
## Usage
|
28
60
|
|
29
61
|
Most typical use case is checking syntax error as following:
|
@@ -41,12 +41,11 @@ class PrestoSqlParser
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def send_line(line)
|
44
|
-
|
44
|
+
@mutex.synchronize do # block kill! during execution
|
45
45
|
start! unless @pipe
|
46
|
-
@pipe
|
46
|
+
@pipe.puts line
|
47
|
+
@last_used_pid = @pipe.pid
|
47
48
|
end
|
48
|
-
pipe.puts line
|
49
|
-
@last_used_pid = pipe.pid
|
50
49
|
nil
|
51
50
|
end
|
52
51
|
|