Git Product home page Git Product logo

Comments (9)

Suleman-Elahi avatar Suleman-Elahi commented on July 22, 2024 1

I don't know what I am doing wrong. Let me try it on Linux and MAC and then I will let you know. I am just in the first year of college so I not confident about it but if it is working fine for you then you can close this issue.

image

The octosql.yaml in my case:

dataSources:
  - name: cut
    type: csv
    config:
      path: "E:/cust.csv"
  - name: people
    type: mysql
    config:
      address: "localhost:3306"
      user: "root"
      password: "mysql"
      databaseName: "test"
      tableName: "people"

from octosql.

cube2222 avatar cube2222 commented on July 22, 2024 1

Hey, great it works for you!

The 0.1.1 sunday release fixes that error ;)

from octosql.

cube2222 avatar cube2222 commented on July 22, 2024

Hey, you have a typo there, you aliased the table cut with c, but later used cut.asin :)

Let me know if it works now!

from octosql.

Suleman-Elahi avatar Suleman-Elahi commented on July 22, 2024

Oh, I was just experimenting with that. However, it still doesn't work. But if you use table name directly in ON then it does shows something.

image

from octosql.

cube2222 avatar cube2222 commented on July 22, 2024

Would it be possible for you to post a describe of your MySQL table? I think it has something to do with types not matching. (I'll make sure to add some helper functions to view type information)

from octosql.

Suleman-Elahi avatar Suleman-Elahi commented on July 22, 2024

Here it is.

image

from octosql.

cube2222 avatar cube2222 commented on July 22, 2024

Hey, looking at your last image you use c.id (even though above it was c.asin). I failed to reproduce your issue.

With a csv table:

asin,name
1,test
2,test2
3,test3

And mysql table (int, text, text):

1	testt	test@test
2	testt2	test2@test
3	testt3	test3@test
4	testt4	test4@test

an octosql.yaml:

dataSources:
  - name: people
    type: mysql
    config:
      address: "localhost:3306"
      user: root
      password: toor
      databaseName: app
      tableName: people
  - name: cut
    type: csv
    config:
      path: "cut.csv"

and invocation:

octosql "SELECT p.email, c.name from cut c JOIN people p ON p.id = c.asin"

I get:

+--------------+---------+
|   p.email    | c.name  |
+--------------+---------+
| 'test@test'  | 'test'  |
| 'test2@test' | 'test2' |
| 'test3@test' | 'test3' |
+--------------+---------+

So you'd have to provide all the files / a docker image with a database with data already included for me to help.

from octosql.

cube2222 avatar cube2222 commented on July 22, 2024

Closing for now, feel free to reopen.

from octosql.

Suleman-Elahi avatar Suleman-Elahi commented on July 22, 2024

Actually my CSV file was in "UTF8 with BOM" encoding which is why it wasn't working. Now, I have changes that to ANSI and it works !!!

Also, one thing that I noted that if some cell is empty in MySQL table then it throws an error and stops.

Thanks.

from octosql.

Related Issues (20)

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.