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

bug: schema detection on CSV, empty entries are assumed to be strings #131

Open
ramfox opened this issue Jun 6, 2018 · 1 comment
Open

Comments

@ramfox
Copy link
Member

ramfox commented Jun 6, 2018

EG:

Name,Home_Runs,Rank
Barry Bonds,762,1
Hank Aaron,755,2
Babe Ruth,714,
Alex Rodriguez,696,4
Willie Mays,660,5

has schema:

"schema": {
  "items": {
    "items": [
      {
        "title": "name",
        "type": "string"
      },
      {
        "title": "home_runs",
        "type": "integer"
      },
      {
        "title": "rank",
        "type": "string"
      }
    ],
    "type": "array"
  },
  "type": "array"
}

Instead of

{
   "title": "rank",
  "type": "string"
}
@ramfox
Copy link
Member Author

ramfox commented Jun 6, 2018

Propose that in ParseType checks for empty byte slice. If empty we say type is TypeEmpty.

If a row has multiple types, but one of those are TypeEmpty, we disregard those when we determine the schema.

Except then what value do we give this field when we marshal into go????

@b5 b5 added the bug label Jun 11, 2018
@b5 b5 added the ready label Feb 18, 2019
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