Skip to content

Commit

Permalink
fix #9: do not fail on mapped tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Nov 15, 2021
1 parent c9c025e commit 97005b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/kx/c.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,14 @@ K.KBase r() throws UnsupportedEncodingException {
if (t == 99)
return new K.Dict(r(), r());
byte attr = b[j++];
if (t == 98)
return new K.Flip((K.Dict) r());
n = ri();
if (t == 98) {
K.Dict d = (K.Dict)r();
if (d.x.getType() == 11 && d.y.getType()>=0) {
return new K.Flip(d);
} else {
return d;
}
} n = ri();
switch (t) {
case 0: {
K.KBase[] array = new K.KBase[n];
Expand Down
8 changes: 7 additions & 1 deletion src/studio/kdb/KTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ public static KTableModel getModel(K.KBase obj) {
}

if (obj instanceof K.Dict) {
return new DictTableModel((K.Dict)obj);
K.Dict dict = (K.Dict) obj;
if ( (dict.x instanceof K.KBaseVector || dict.x instanceof K.Flip) &&
(dict.y instanceof K.KBaseVector || dict.y instanceof K.Flip) ) {
return new DictTableModel((K.Dict) obj);
} else {
return null; // dict for memory mapped table
}
}

if ((obj instanceof K.KBaseVector) && obj.getType() != 10 && obj.getType() != 4) {
Expand Down

0 comments on commit 97005b0

Please sign in to comment.