Sqllogictest parser and runner in Rust.

Overview

Sqllogictest-rs

Crate Docs CI

Sqllogictest parser and runner in Rust.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • support more type in postgres-extended

    support more type in postgres-extended

    This PR does two things:

    1. support INTERVAL && TIMESTAMPTZ type in postgres-extended
    2. refactor run() in postgres-extended: use a macro to generate process
    opened by ZENOTME 10
  • support extended query mode

    support extended query mode

    Support extended query mode. It's compatible with past versions, extended query mode only takes effect when using the flag "--extend"

    for now, this pr has the following limit:

    • we only support most common type in binary format (but not all the type.
    • rust-postgres only support one-dimensional array type.

    Hence we can run all original e2e test now.

    opened by ZENOTME 8
  • fix: trim string before rowsort

    fix: trim string before rowsort

    Signed-off-by: Runji Wang [email protected]

    If the engine returns a value with leading spaces, it will affect the result of rowsort, but won't be recognized in error message since we trim the string before reporting error but after the rowsort. This PR trims the string before rowsort to avoid this problem. Despite this, engines should not return a value with leading or tailing space.

    opened by wangrunji0408 7
  • Proposal: support syntax

    Proposal: support syntax "SET DEFAULT [GLOBAL] $SortMode"

    In distributed environment, the order of query result set is uncertain, which is also not required in SQL without "ORDER BY".

    To simplify the test script, we can support syntax like SET DEFAULT [GLOBAL] $SortMode to set the default sort mode required by query statement in the current file or all files, instead of specify sort mode after each. query statement.

    opened by MrCroxx 6
  • Support optional error string

    Support optional error string

    statement error string::interval: context-dependent operators are not allowed in computed column\nHINT: STRING to INTERVAL casts depend on session IntervalStyle; use parse_interval\(string\) instead
    CREATE TABLE invalid_table (
      invalid_col interval AS ('1 hour'::string::interval) STORED
    )
    

    Statement error is also a part of the testing. In some circumstances, we may expect the system to produce errors as expected.

    opened by neverchanje 5
  • feat: support load balancing of multiple addr

    feat: support load balancing of multiple addr

    In some cases, we may want to test whether concurrent sessions from different stateless database frontends are working correctly. This PR allows users to specify multiple (host, port)s and make sqllogictest choose one randomly per session.

    Related: https://github.com/singularity-data/risingwave/issues/4720

    opened by BugenZhao 4
  • refactor: moving binary to sqllogictest-bin

    refactor: moving binary to sqllogictest-bin

    It's becoming more and more complex, so it would be good to have a separate crate.

    cc @xxchan do you want to work on this? If so feel free to assign yourself. Otherwise I'll do the refactor maybe this month.

    opened by skyzh 4
  • A finally-statement-like code block to clean up things

    A finally-statement-like code block to clean up things

    Sometimes, the test files are maintained by different people and they may use the same name for a table or view. This is reasonable as we may view these test files as independent units.

    When some test case in one test file failed, sqllogictest proceeds to execute another test file. Without dropping all of the tables and views, it can cause table exists failure in the coming tests.

    Therefore, this issue proposes that we may have a finally statement like mechanism to clean up things. Statement in the finally code block would be always executed at last.

    Is this mechanism worth implementing? Not necessarily design and implement it in this way, though.

    opened by lmatz 4
  • Add `update_record_with_output` function and tests

    Add `update_record_with_output` function and tests

    ~Draft as it builds on https://github.com/risinglightdb/sqllogictest-rs/pull/129~

    Rationale

    I want to be able to update Records given the output of a particular run (see https://github.com/apache/arrow-datafusion/issues/4570)

    Changes

    1. Add update_record_with_output function
    2. Tests

    I think this is my last planned PR to sqllogictest for a bit (I want to go try and integrated this into DataFusion upstream first)

    opened by alamb 3
  • Improve the ability to parse/unparse files

    Improve the ability to parse/unparse files

    First of all, thank you again for this library -- it is really awesome.

    Rationale

    I am trying to implement "test script completion mode" in DataFusion. In order to do so, I would like to be able to update parsed Records with new output and then write them back to a file. Ideally the only changes in the file would be the new results and the original file will have all the comments, whitespace, etc.

    DataFusion ticket: https://github.com/apache/arrow-datafusion/issues/4570, https://github.com/apache/arrow-datafusion/issues/4570#issuecomment-1345252492

    Changes

    1. Add impl Display for Record (refactor unparse)
    2. Add tests for roundtrip parsing / unparsing
    3. Add Record::Whitespace so the whitespace in the original files can be reconstructed (found during testing)

    Questions

    1. I had a question about whitespace after Record::Statement and RecordQuery which I will note inline
    2. If you accept this change, I would be happy to add more round trip parsing tests for the other example files
    opened by alamb 3
  • feat: support hook function after query

    feat: support hook function after query

    This PR allows users to add hook functions after each query or statement completes. For example, to test fault recovery, I'd like to kill nodes and wait for a while between queries. In this case I can register a custom function using these API.

    opened by wangrunji0408 3
  • Add test for sqllogictest

    Add test for sqllogictest

    As a testing framework, we need to ensure our correctness. Currently we can be relatively confident whether previously passed tests will fail after upgrading sqllogictest by testing agains real usage in e.g., risingwave. But it would definitely be better to add a test suite in our repo. https://github.com/risinglightdb/sqllogictest-rs/pull/123

    A more dangerous problem which is also harder to detect is that we won't pass previously failed tests. Imagine that after some changes, we allow all test cases to pass. 😇 We need to test errors.

    Here's an example of error that won't be run:

    https://github.com/risinglightdb/sqllogictest-rs/blob/d753e4c77fbf00cdaab69477df2e9c3dba3f5fcc/examples/basic/basic.slt#L32-L34

    opened by xxchan 0
  • test against sqlite's test suite

    test against sqlite's test suite

    • [ ] test failure https://github.com/risinglightdb/sqllogictest-rs/issues/122
    • fix https://github.com/risinglightdb/sqllogictest-rs/issues/108
    • [ ] files too large. use git submodule or sth? 🤪 Currently only added some files
    opened by xxchan 1
  • parser: comment at the end of the line is not supported

    parser: comment at the end of the line is not supported

    It's used in sqlite's test suite e.g.,

    https://github.com/risingwavelabs/sqlite-sqllogictest/blob/aa3e4345dff63b65ef0d0969872ffa2b4a685225/test/evidence/in1.test#L39-L43

    opened by xxchan 1
  • TestError::display is hard to use

    TestError::display is hard to use

    Because users generally will return Result in tests, and there's no change to call display(true) to get colorful error message. If it's printed, it will be duplicate with the Err.

    Maybe we can refer to https://docs.rs/pretty_assertions/latest/pretty_assertions/ about how can we opt-in colorful message in library usage.

    opened by xxchan 0
  • CLI: support multiple files as input

    CLI: support multiple files as input

    so that it can be used in a pipeline's fasion, or multiple globs (expanded by shell).

    Currently it accepts a single glob string argument, so it also need to be quoted.

    e.g.,

    ❯ sqllogictest ./**/*.slt  
    error: Found argument './examples/condition/condition.slt' which wasn't expected, or isn't valid in this context
    
    opened by xxchan 0
Releases(v0.10.0)
Owner
Singularity Data Inc.
Singularity Data Inc.
Website for Microformats Rust parser (using 'microformats-parser'/'mf2')

Website for Microformats Rust parser (using 'microformats-parser'/'mf2')

Microformats 5 Jul 19, 2022
Pure, simple and elegant HTML parser and editor.

HTML Editor Pure, simple and elegant HTML parser and editor. Examples Parse HTML segment/document let document = parse("<!doctype html><html><head></h

Lomirus 16 Nov 8, 2022
A native Rust port of Google's robots.txt parser and matcher C++ library.

robotstxt A native Rust port of Google's robots.txt parser and matcher C++ library. Native Rust port, no third-part crate dependency Zero unsafe code

Folyd 72 Dec 11, 2022
🕑 A personal git log and MacJournal output parser, written in rust.

?? git log and MacJournal export parser A personal project, written in rust. WORK IN PROGRESS; NOT READY This repo consolidates daily activity from tw

Steven Black 4 Aug 17, 2022
A CSS parser, transformer, and minifier written in Rust.

@parcel/css A CSS parser, transformer, and minifier written in Rust. Features Extremely fast – Parsing and minifying large files is completed in milli

Parcel 3.1k Jan 9, 2023
An IRC (RFC1459) parser and formatter, built in Rust.

ircparser An IRC (RFC1459) parser and formatter, built in Rust. ircparser should work on basically any Rust version, but the earliest version checked

Ethan Henderson 2 Oct 18, 2022
A WIP svelte parser written in rust. Designed with error recovery and reporting in mind

Svelte(rs) A WIP parser for svelte files that is designed with error recovery and reporting in mind. This is mostly a toy project for now, with some v

James Birtles 3 Apr 19, 2023
A rusty, dual-wielding Quake and Half-Life texture WAD parser.

Ogre   A rusty, dual-wielding Quake and Half-Life texture WAD parser ogre is a rust representation and nom parser for Quake and Half-Life WAD files. I

Josh Palmer 16 Dec 5, 2022
A modern dialogue executor and tree parser using YAML.

A modern dialogue executor and tree parser using YAML. This crate is for building(ex), importing/exporting(ex), and walking(ex) dialogue trees. convo

Spencer Imbleau 27 Aug 3, 2022
Org mode structural parser/emitter with an emphasis on modularity and avoiding edits unrelated to changes.

Introduction Org mode structural parser/emitter with an emphasis on modularity and avoiding edits unrelated to changes. The goal of this library is to

Alex Roper 4 Oct 7, 2022
Parser for Object files define the geometry and other properties for objects in Wavefront's Advanced Visualizer.

format of the Rust library load locad blender obj file to Rust NDArray. cargo run test\t10k-images.idx3-ubyte A png file will be generated for the fi

Nasser Eddine Idirene 1 Jan 3, 2022
Lexer and parser collections.

laps Lexer and parser collections. With laps, you can build parsers by just defining ASTs and deriving Parse trait for them. Usage Add laps to your pr

MaxXing 11 Jan 27, 2023
Rust parser combinator framework

nom, eating data byte by byte nom is a parser combinators library written in Rust. Its goal is to provide tools to build safe parsers without compromi

Geoffroy Couprie 7.6k Jan 7, 2023
Parsing Expression Grammar (PEG) parser generator for Rust

Parsing Expression Grammars in Rust Documentation | Release Notes rust-peg is a simple yet flexible parser generator that makes it easy to write robus

Kevin Mehall 1.2k Dec 30, 2022
A fast monadic-style parser combinator designed to work on stable Rust.

Chomp Chomp is a fast monadic-style parser combinator library designed to work on stable Rust. It was written as the culmination of the experiments de

Martin Wernstål 228 Oct 31, 2022
A parser combinator library for Rust

combine An implementation of parser combinators for Rust, inspired by the Haskell library Parsec. As in Parsec the parsers are LL(1) by default but th

Markus Westerlind 1.1k Dec 28, 2022
LR(1) parser generator for Rust

LALRPOP LALRPOP is a Rust parser generator framework with usability as its primary goal. You should be able to write compact, DRY, readable grammars.

null 2.4k Jan 7, 2023
A typed parser generator embedded in Rust code for Parsing Expression Grammars

Oak Compiled on the nightly channel of Rust. Use rustup for managing compiler channels. You can download and set up the exact same version of the comp

Pierre Talbot 138 Nov 25, 2022
Rust query string parser with nesting support

What is Queryst? This is a fork of the original, with serde and serde_json updated to 0.9 A query string parsing library for Rust inspired by https://

Stanislav Panferov 67 Nov 16, 2022