Code Monkey home page Code Monkey logo

brackit's People

Contributors

alvinkuruvilla avatar artwo avatar caetanosauer avatar dependabot[bot] avatar johanneslichtenberger avatar ksclarke avatar mosheduminer avatar mureinik avatar rishikumarray avatar sebbae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

brackit's Issues

Function overloading in user code not working correctly

When running the following code:

declare function local:dummy($test) {
    $test
};

declare function local:dummy() {
    local:dummy("test")
};

local:dummy("test")

I get the expected output (test).

However, when changing the last line to

local:dummy()

I get an error: Error: err:XPST0017: Unknown function: local:dummy().

Expected behavior is that brackit should call the second declaration of local:dummy().

Integrate DIAMetrics principles into a benchmarking suite for brackit

Background on DIAMetrics

DIAMetrics is an end-to-end benchmarking and performance framework for query engines developed by Google.

Componenets

Note that there are more details than mentioned here; this is only as an overview, and if we need to add details about more parts, we can do that further down the line

Workload Extractor:

According to the paper, this component extracts a "representative workload" from a live production workload. "DIAMetrics employs a workload extractor and summarizer, which is a feature-based way to β€˜mine’ the query logs of a customer and extract a subset of queries that adequately represent the workload of the customer."
For our current purposes, I feel like the best way we can utilize a component like this is to pinpoint a set of heavy workloads that we can keep a list of and then just run those workloads for the time being. To this end, I am working on a PR that will hopefully bring more XQuery files for us to run against from this repository. I will update this issue with a PR number so that we can keep track of everything.

Data and Query Scrambler

This component aims to help protect sensitive data and create variations of the representative sets to prevent sensitive data leakage. The paper lists off a few ways that they achieve this, but for the time being, we can put less emphasis on this part since we will use this internally for the moment.

Workload Runner

According to the paper, this component "allows users to specify various combinations of workloads and systems to be benchmarked. For instance, we may want to run TPC-H on various query engines over various storage formats to see which storage format is the best option for which engine." The runner can either schedule runs of specific engines or spin up and manage (including cleanup and shutdown) entire engine instances for the runs

Monitoring

There are two parts to this:

  1. Visualization Framework - which brings up dashboards
  2. Alerting Framework - which compares workload performance to historical data and alerts when there iareconcerns

TODO (more to come as we get further along)

  • Merge in more XQuery files from xquerl
  • Figure out workloads that do not perform well and add them to brackit
  • Extract representative workloads somehow

Examples attempts to instantiate QueryContext

In Simple.java, for example this line is used:

    QueryContext ctx = new QueryContext();

However, when running the file with

javac -cp target/brackit-0.1.11-SNAPSHOT-jar-with-dependencies.jar src/examples/java/org/brackit/examples/Simple.java

We get the following error:

src/examples/java/org/brackit/examples/Simple.java:57: error: QueryContext is abstract; cannot be instantiated
    QueryContext ctx = new QueryContext();
                       ^

Git hook to autoformat source code

We need a pre commit hook or something like that to auto-format code according to our IntelliJ Java Formatter or the Kotlin standard code formatting rules.

Implement the DerefDescendantExpr

Implementation of the DerefDescendantExpr currently is a copy of an old version of the DerefExpr, which drilled down into arrays and lookups the right operand for the objects in this array. Now the semantics for ->>foobar should be that it drills down into objects as well and to find values of objects, which have a foobar field in a predorder traversal.

Simple CLI

Brackit currently offers a "one-shot" query through params or STDIN, but we should provide a simple CLI tool, which can execute several queries in a row.

And expressions evaluated in reverse order

When querying the following JSON (using the sirix rest-api):

[{"key": "hey"}, {"key": 0}]

with the following query:

for $i in bit:array-values(.)
where $i=>key instance of xs:integer and $i=>key eq 0
return $i

I get the following error:

Cannot compare 'xs:string' with 'xs:integer'

However, the AndExpr should short-circuit after evaluating key to not be an instance of xs:integer, rather than throwing an error.

It should be noted that the following query:

for $i in bit:array-values(.)
where $i=>key eq 0 and $i=>key instance of xs:integer
return $i

returns:

{'key': 0}

so it appears that the order of the AndExpr is being reversed.

Add switch to enable/disable XQuery syntax parsing

We have to add a switch to enable/disable XQuery syntax parsing and to improve the syntax of JSON queries per default. For instance I'd like to get rid of [[ ]] for array indexes and replace it with the common [ ] syntax. Therefore XPath predicates must have another syntax.

Furthermore, we might think about switching the object field deref expression -> to . and to switch the current context item from . to $$ as in the JSONiq specification stated. Furthermore, literals as true and false should then be parsed as the boolean literal types instead of as XPath axis steps. Furthermore it would be handy if object fields doesn't have to be quoted in this case {"foo":"bar"} and {foo:"bar"} should both be possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.