Skip to content

BUG insert dataset depends on INTERNAL ds order. #18

@awb99

Description

@awb99

I found a weird bug when inserting a dataset via (duckdb/insert-dataset! (:conn session) ds)
Sometimes the insert fails, even though all columns are the same and all data-types are the same
as defined via (duckdb/create-table! (:conn session) ds)

From printing the initial dataset that was used to create the table, I have deducted the order in
which tml-ds has arranged the columns internally. I replicate this via (order-columns-strange ds).
When I want call insert-dataset! via a differently arranged dataset, for example: (order-columns ds),
then the insert throws an exception.

This is a weird behavior which I have not have expected.

This is the code I used to get the inserts to work / not-work:

(defn order-columns [ds]
  (tc/dataset [(:date ds)
               (:asset ds)
               (:open ds)
               (:high ds)
               (:low ds)
               (:close ds)
               (:volume ds)
               (:epoch ds)
               (:ticks ds)]))

(defn order-columns-strange [ds]
  (tc/dataset [(:open ds)
               (:epoch ds)
               (:date ds)
               (:close ds)               
               (:volume ds)
               (:high ds)
               (:low ds)
               (:ticks ds)
               (:asset ds)
               ]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions