Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show correct data types in /cli_json #2143

Open
1 of 9 tasks
sanikolaev opened this issue May 7, 2024 · 2 comments
Open
1 of 9 tasks

Show correct data types in /cli_json #2143

sanikolaev opened this issue May 7, 2024 · 2 comments
Assignees

Comments

@sanikolaev
Copy link
Collaborator

sanikolaev commented May 7, 2024

Bug Description:

/cli_json shows confusing data types (string instead of multi, string instead of json etc.)

snikolaev@dev2:~$ mysql -P9306 -h0 -e "drop table if exists t; create table t(i int, f float, s string, t text, b bigint, j json, m multi)"
snikolaev@dev2:~$ curl -s 0:9308/cli_json -d 'select * from t'|jq .
[
  {
    "columns": [
      {
        "id": {
          "type": "long long"
        }
      },
      {
        "i": {
          "type": "long"
        }
      },
      {
        "f": {
          "type": "float"
        }
      },
      {
        "s": {
          "type": "string"
        }
      },
      {
        "b": {
          "type": "long long"
        }
      },
      {
        "j": {
          "type": "string"
        }
      },
      {
        "m": {
          "type": "string"
        }
      },
      {
        "t": {
          "type": "string"
        }
      }
    ],
    "data": [],
    "total": 0,
    "error": "",
    "warning": ""
  }
]

As discussed on dev call of May 6 2024, we don't want to hide the columns/data types completely. desc <table name> is an alternative, but it can make things more complicated for the user in some cases. Instead, it makes sense to make the data types consistent with the actual data types of the returned values.

Manticore Search Version:

Manticore 6.2.13 e12bc4f67@24050620 dev (columnar 2.2.5 0c18998@240424) (secondary 2.2.5 0c18998@240424) (knn 2.2.5 0c18998@240424)

Operating System Version:

Ubuntu Jammy (dev2)

Have you tried the latest development version?

  • Yes

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

  • Task estimated
  • Specification created, reviewed, and approved
  • Implementation completed
  • Tests developed
  • Documentation updated
  • Documentation proofread
  • Changelog updated
  • Update OpenAPI yaml
@sanikolaev
Copy link
Collaborator Author

This task blocks manticoresoftware/manticoresearch-python#14

@sanikolaev
Copy link
Collaborator Author

We've discussed this with Alexey and it seems it's better not only to show proper data types in the columns, but return arrays (multi, multi64 and float_vector) and json as it w/o converting them to strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants