Giter VIP home page Giter VIP logo

datafusion-tui's Introduction

datafusion-contrib

datafusion-tui's People

Contributors

jimexist avatar matthewmturner avatar seryj 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  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

datafusion-tui's Issues

Editor navigation/usage issues

First of all, thanks for creating and working on this project! A good graphical interface will definitely help a lot of people in the future!

Now, to my issues. While playing around, there were several situations when the application crashed/or behaved wrongly/not-expected in the editor window.

Crashes:

  1. When using non-ascii characters (like German "umlaut" character ä, ö, ü), the application crashes when such a character is deleted. The issue is that non-ascii chars consume more then 1 byte but currently all operations in the editor directly change the bytes inside of the string (Lines) object.
  2. When the editor is opened and there is no text inside, moving the cursor crashes the application.

Wrong behavior:

  1. When typing a character inside a line, the character appears in the end of the line. (I think this one was already fixed)

Usability issues:

  1. In the end of the line, when moving a cursor to the right, the cursor stays in the same line instead of jumping to the next one
  2. In the beginning of a line, when moving a cursor to the left the cursor stays in the same line instead of jumping to the previous one
  3. End/Home buttons do not work

While all issues except for non-ascii handling are not that big, handling non-ascii characters requires a re-implementation of almost all functions of the Editor object because direct changing of a byte inside the String object does not work anymore and one has to use Chars instead.

This being said, I can offer an PR where above mentioned issues are addressed and appropriate unit tests are provided. But of course only if contribution to this project is desired. Alternatively, I could provide an PR with unit tests only. Whatever you prefer.

Best regards

Overflow when backspacing

When entering a single line of text, creating multiple new lines with enter, and then backspace to first line. Cursor also doesnt show at right position when going back to first line.

Testing Overview

  • Editor: The idea is to test different inputs that can be received from user while in Edit mode of a SQL Editor and ensure that the Input reflects these inputs. It is very context dependent. For example different keys have different expected behavior depending on where they are on the editor (i.e. you cant go up a row when already on the top row).
    • The function edit_mode_handler has all supported keys. Look at these keys and coming up with the attendant tests is a good place to start.
    • The correct handling of scrolling will also need to be tested. This happens when cursor is moving at end of block and ensuring the correct text is shown.
    • A second priority could be ensuring navigation between tabs is handled correctly
    • Key inputs can be done on Input directly but also, and its probably better, on Key events.
  • Context: This involves testing that queries and their results are properly integrated back into the app. I.e. if a successful query is executed then it should generate QueryResult with the appropriate QueryResultMeta data.
    • Test successful and unsuccessful queries to ensure results handled appropriately
  • Configuration: the .datafusion directory is critical in making dft a powerful and reproducible tool for data analysis. It has the .datafusion/.datafusionrc file for DDL and the .datafusion/object_stores and .datafusion/table_providers for extending the core with custom data sources (i.e. S3, Bigtable, HTTP APIs). These extensions will often be feature gated.
    • Having tests that create dummy versions of the relevant files and ensuring that they either load the relevant data source or error correctly is needed.
    • UI - Test that drawing UI components returns the correct output, in particular in the context of errors.

We should add some test data to the repo to enable testing queries in CI

Support BigTable

Add ~/.datafusion/table_providers/bigtable.json which stores configuration options to create TableProvider and add optional BigTable feature. Tables defined in bigtable.json are loaded at startup.

Config fields comes from the below plus a table name field.

let bigtable_datasource = BigtableDataSource::new(
    "emulator".to_owned(),                               // project
    "dev".to_owned(),                                    // instance
    "weather_balloons".to_owned(),                       // table
    "measurements".to_owned(),                           // column family
    vec!["_row_key".to_owned()],                         // table_partition_cols
    "#".to_owned(),                                      // table_partition_separator
    vec![Field::new("pressure", DataType::Utf8, false)], // qualifiers
    true,                                                // only_read_latest
).await.unwrap();

Explore alternatives for executing a query

I wonder if one needs a semicolon at all. Right now, the editor always contains a single query and unless this changes in the future, having a semicolon is only required to recognize that the user wants to execute a query. Thinking about other tools, the same problem is often solved by using another key combination e.g. "shift+enter". Could that maybe be a more user-friendly solution?

On the pro-side, if chosen carefully, this "execute query" key combination could be used in the normal and edit modes such that the users will do less mistakes.

On the contra-side, the complexity of key handling increases.

How do you see it?

Originally posted by @seryj in #73 (comment)

No error message for invalid sql statements

Error description
When executing an invalid query there is no feedback to the user that something went wrong. The result tab just shows the result of previous query. Also in the log tab, there is no indication that something went wrong.

An invalid query can be

  • a wrong SQL statement
  • valid SQL but with wrong table name

Expected behavior
Some kind of error message/warning. Maybe for beginning, it is possible to show the error message from DataFusion itself?

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.