Merge branch 'master' of https://github.com/sunyinqi0508/AQuery2
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
docker buildx build --platform=linux/amd64 -t ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} .
|
||||||
|
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}}
|
||||||
|
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} ${{ secrets.DOCKERHUB_USERNAME }}/aquery:latest
|
||||||
|
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aquery:latest
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
AQuery++ Database is a cross-platform, In-Memory Column-Store Database that incorporates compiled query execution. (**Note**: If you encounter any problems, feel free to contact me via ys3540@nyu.edu)
|
AQuery++ Database is a cross-platform, In-Memory Column-Store Database that incorporates compiled query execution. (**Note**: If you encounter any problems, feel free to contact me via ys3540@nyu.edu)
|
||||||
|
|
||||||
`## Docker (Recommended):
|
## Docker (Recommended):
|
||||||
- See installation instructions from [docker.com](https://www.docker.com). Run **docker desktop** to start docker engine.
|
- See installation instructions from [docker.com](https://www.docker.com). Run **docker desktop** to start docker engine.
|
||||||
- In AQuery root directory, type `make docker` to build the docker image from scratch.
|
- In AQuery root directory, type `make docker` to build the docker image from scratch.
|
||||||
- For Arm-based Mac users, you would have to build and run the **x86_64** docker image because MonetDB doesn't offer official binaries for arm64 Linux. (Run `docker buildx build --platform=linux/amd64 -t aquery .` instead of `make docker`)
|
- For Arm-based Mac users, you would have to build and run the **x86_64** docker image because MonetDB doesn't offer official binaries for arm64 Linux. (Run `docker buildx build --platform=linux/amd64 -t aquery .` instead of `make docker`)
|
||||||
|
|||||||
+10
-10
@@ -296,7 +296,7 @@ class projection(ast_node):
|
|||||||
if 'outfile' in node:
|
if 'outfile' in node:
|
||||||
self.outfile = outfile(self, node['outfile'], sql = self.sql)
|
self.outfile = outfile(self, node['outfile'], sql = self.sql)
|
||||||
if not self.has_postproc:
|
if not self.has_postproc:
|
||||||
self.sql += self.outfile.sql
|
self.sql = self.outfile.sql
|
||||||
else:
|
else:
|
||||||
self.outfile = None
|
self.outfile = None
|
||||||
|
|
||||||
@@ -398,10 +398,10 @@ class projection(ast_node):
|
|||||||
else:
|
else:
|
||||||
self.context.emitc(f'{self.out_table.contextname_cpp}->printall(" ","\\n", nullptr, nullptr, {self.limit});')
|
self.context.emitc(f'{self.out_table.contextname_cpp}->printall(" ","\\n", nullptr, nullptr, {self.limit});')
|
||||||
|
|
||||||
if self.outfile:
|
if self.outfile and self.has_postproc:
|
||||||
self.outfile.finalize()
|
self.outfile.finalize()
|
||||||
|
|
||||||
if 'into' in node:
|
if 'into' in node:
|
||||||
self.context.emitc(select_into(self, node['into']).ccode)
|
self.context.emitc(select_into(self, node['into']).ccode)
|
||||||
self.has_postproc = True
|
self.has_postproc = True
|
||||||
if not self.distinct:
|
if not self.distinct:
|
||||||
@@ -417,7 +417,7 @@ class projection(ast_node):
|
|||||||
self.context.postproc_end(self.postproc_fname)
|
self.context.postproc_end(self.postproc_fname)
|
||||||
else:
|
else:
|
||||||
self.context.ccode = ''
|
self.context.ccode = ''
|
||||||
if self.limit != 0:
|
if self.limit != 0 and not self.outfile:
|
||||||
self.context.direct_output()
|
self.context.direct_output()
|
||||||
|
|
||||||
class select_distinct(projection):
|
class select_distinct(projection):
|
||||||
@@ -1186,8 +1186,8 @@ class outfile(ast_node):
|
|||||||
name="_outfile"
|
name="_outfile"
|
||||||
def __init__(self, parent, node, context = None, *, sql = None):
|
def __init__(self, parent, node, context = None, *, sql = None):
|
||||||
self.node = node
|
self.node = node
|
||||||
super().__init__(parent, node, context)
|
|
||||||
self.sql = sql if sql else ''
|
self.sql = sql if sql else ''
|
||||||
|
super().__init__(parent, node, context)
|
||||||
|
|
||||||
def init(self, _):
|
def init(self, _):
|
||||||
assert(isinstance(self.parent, projection))
|
assert(isinstance(self.parent, projection))
|
||||||
@@ -1207,10 +1207,10 @@ class outfile(ast_node):
|
|||||||
def produce_monetdb(self, node):
|
def produce_monetdb(self, node):
|
||||||
filename = node['loc']['literal'] if 'loc' in node else node['literal']
|
filename = node['loc']['literal'] if 'loc' in node else node['literal']
|
||||||
import os
|
import os
|
||||||
p = os.path.abspath('.').replace('\\', '/') + '/' + filename
|
p = os.path.abspath('.').replace('\\', '/') + '/' + filename
|
||||||
self.sql = f'COPY {self.sql} INTO "{p}"'
|
self.sql = f'COPY {self.parent.sql} INTO \'{p}\''
|
||||||
d = '\t'
|
d = ','
|
||||||
e = '\n'
|
e = '\\n'
|
||||||
if 'term' in node:
|
if 'term' in node:
|
||||||
d = node['term']['literal']
|
d = node['term']['literal']
|
||||||
self.sql += f' delimiters \'{d}\', \'{e}\''
|
self.sql += f' delimiters \'{d}\', \'{e}\''
|
||||||
|
|||||||
@@ -253,6 +253,10 @@ class Context:
|
|||||||
def direct_output(self):
|
def direct_output(self):
|
||||||
self.queries.append('O')
|
self.queries.append('O')
|
||||||
|
|
||||||
|
def abandon_postproc(self):
|
||||||
|
self.ccode = ''
|
||||||
|
self.finalize_query()
|
||||||
|
|
||||||
def finalize_udf(self):
|
def finalize_udf(self):
|
||||||
if self.udf is not None:
|
if self.udf is not None:
|
||||||
return (Context.udf_head
|
return (Context.udf_head
|
||||||
|
|||||||
Reference in New Issue
Block a user