Skip to content

Commit

Permalink
Merge pull request #510 from mabel-dev/v0.4.0
Browse files Browse the repository at this point in the history
V0.4.0
  • Loading branch information
joocer authored Sep 12, 2022
2 parents 17e49ed + 0eb0d5c commit 983f8c9
Show file tree
Hide file tree
Showing 44 changed files with 173 additions and 126 deletions.
2 changes: 1 addition & 1 deletion docs/Contributor Guide/01 Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Welcome to the Opteryx Contributor Guide.**

In this section you will find information to help you to bring your unique skills and experience and join us in building
In this section you will find information to help you to bring your unique skills and experience and join us in building Opteryx.

Opteryx is primarily written in Python, but you don't need to be a Python developer to contribute. All contributions, [bug reports](https://github.com/mabel-dev/opteryx/issues/new/choose), documentation improvements, and [ideas](https://github.com/mabel-dev/opteryx/discussions) are welcome.

Expand Down
3 changes: 2 additions & 1 deletion docs/Contributor Guide/95 Project Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ Opteryx's repository folder structure is described below:
├── connectors/ <- modules to connect to data sources
├── functions/ <- modules to execute functions within SQL statements
├── managers/ <- libraries responsible for key functional units
│ ├── cache/ <- modules implementing the caching mechanism
mechanism
│ ├── expression/ <- modules implementing expression evaluation
│ ├── kvstore/ <- modules implementing interfacing with KV Stores (internal usage)
│ ├── process/ <- modules implementing process management
│ ├── query/
│ │ └── planner/ <- modules implementing query planning
Expand Down
1 change: 0 additions & 1 deletion docs/Deployment/Internals/Query Engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

> If you are interested in how databases work, I recommend the resources from [The CMU Database Group](https://db.cs.cmu.edu/) and the collection of resources at [Awesome Database Learning](https://github.com/pingcap/awesome-database-learning).

The Opteryx query engine has the following key components and general process:

1) The Parser & Lexer, which recieves the user SQL and builds an Abstract Syntax Tree (AST).
Expand Down
12 changes: 12 additions & 0 deletions docs/Features/Command Line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Command Line Interface

Opteryx supports being used on the command line to process files using SQL to filter and process files.

The full SQL feature set (e.g. time travel, caching) is available using the CLI.

The CLI can be used to be used to save the results to output files for onward processing:

- direct to the console
- CSV
- PARQUET
- JSONL
2 changes: 1 addition & 1 deletion docs/Release Notes/Change Log.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file, where appro

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.4.0] - 2022-09-12

**Added**

Expand Down
4 changes: 4 additions & 0 deletions opteryx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@
MAX_SIZE_SINGLE_CACHE_ITEM: int = _config.get("MAX_SIZE_SINGLE_CACHE_ITEM", 1024 * 1024)
# Approximate Page Size
PAGE_SIZE: int = _config.get("PAGE_SIZE", 64 * 1024 * 1024)


# The number of metadata cache records to hold
LOCAL_METADATA_CACHE: int = int(_config.get("LOCAL_METADATA_CACHE", 512))
# fmt:on
4 changes: 2 additions & 2 deletions opteryx/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pyarrow import Table

from opteryx.exceptions import CursorInvalidStateError, ProgrammingError, SqlError
from opteryx.managers.cache import BaseBufferCache
from opteryx.managers.kvstores import BaseKeyValueStore
from opteryx.models import QueryStatistics
from opteryx.utils import arrow

Expand All @@ -39,7 +39,7 @@ class Connection:
def __init__(
self,
*,
cache: Optional[BaseBufferCache] = None,
cache: Optional[BaseKeyValueStore] = None,
**kwargs,
):
self._results = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .base_buffer_cache import BaseBufferCache
from .memcached_cache import MemcachedCache
from .memory_cache import InMemoryCache
from .base_kv_store import BaseKeyValueStore

from .kv_firestore import FireStoreKVStore
from .kv_memory import InMemoryKVStore
from .kv_local import LocalKVStore
from .kv_memcached import MemcachedKVStore
from .kv_mongodb import MongoDbKVStore
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This is a Base class for a caching layer.
This is a Base class for KV Value Storage adapter.
It's used by injecting an instantiated object into the Reader. If the object in None
we skip any caching, if it's set up, we use it as an aside cache.
This is used by the metadata store and in-memory buffer cache.
"""
import abc
from typing import Optional


class BaseBufferCache(abc.ABC):
class BaseKeyValueStore(abc.ABC):
"""
Base class for cache objects
"""
Expand Down
7 changes: 7 additions & 0 deletions opteryx/managers/kvstores/kv_firestore.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TODO: rocks db

from opteryx.managers.kvstores import BaseKeyValueStore


class FireStoreKVStore(BaseKeyValueStore):
pass
7 changes: 7 additions & 0 deletions opteryx/managers/kvstores/kv_local.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TODO: rocks db

from opteryx.managers.kvstores import BaseKeyValueStore


class LocalKVStore(BaseKeyValueStore):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io
import os
from opteryx.exceptions import MissingDependencyError
from opteryx.managers.cache import BaseBufferCache
from opteryx.managers.kvstores import BaseKeyValueStore

try:
# added 3.9
Expand Down Expand Up @@ -65,7 +65,7 @@ def _memcached_server(**kwargs):
)


class MemcachedCache(BaseBufferCache):
class MemcachedKVStore(BaseKeyValueStore):
"""
Cache object
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import io

from opteryx.managers.cache import BaseBufferCache
from opteryx.managers.kvstores import BaseKeyValueStore


class InMemoryCache(BaseBufferCache):
class InMemoryKVStore(BaseKeyValueStore):
def __init__(self, **kwargs):
"""
Parameters:
Expand Down
7 changes: 7 additions & 0 deletions opteryx/managers/kvstores/kv_mongodb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TODO: rocks db

from opteryx.managers.kvstores import BaseKeyValueStore


class MongoDbKVStore(BaseKeyValueStore):
pass
Loading

0 comments on commit 983f8c9

Please sign in to comment.