Pymapd query error


#1
query = 'SELECT  "mproduct".m_num, "mproduct".m_product_group FROM "mproduct", "mSO_ITEM" WHERE "mSO_ITEM".m_productId = "mproduct".m_id  LIMIT 501'
res = c.execute(query)
print(res.fetchall())```

i run this query but i got error as:
pymapd.exceptions.Error: Exception: Hash join failed, reason(s): For hash join, both sides must have the same nullability

in above query both m_productid and m_id is integer

#2

the fields used in the join condition have to be both NULLABLE or NOT NULLABLE


#3

thank you for your time


#4

how to change a column’s modifiers using command in mapd


#5
  1. You can drop, recreate adding/substracting not null from the columns and reload the table.

  2. you can add a column with the same datatype to the table, do a massive update on the new column with the data of the old column, then rename both the columns e,g,

    mapdql> alter table reporting_timestamp2 add(data_rep2 date);
    mapdql> update reporting_timestamp2 set data_rep2=data_rep;
    mapdql> alter table reporting_timestamp2 RENAME COLUMN data_rep to data_rep_old;
    mapdql> alter table reporting_timestamp2 RENAME COLUMN data_rep2 to data_rep;
    mapdql> \d reporting_timestamp2
    CREATE TABLE reporting_timestamp2 (
    data_rep_old DATE NOT NULL,
    data_rep DATE)

  3. create a new table, then load with the data from the old table then drop the old one and rename the new one


#6

ok i got it
is there any way to check number of records in mapd using query

i have used select count(*) from “m86775bb6_877a_47bb_b281_3c498b743516”;
is this correct


#7

Yap It would work in mapd; i doubt It would work in oracle, because of the lenght of table name