Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Apr 18, 2023
1 parent 8c87729 commit 94b50ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,22 @@ type Table
queries = all_tables.map_with_index i-> t->
columns_to_select = good_columns.map description->
column_set = description.first
result_type = description.second
column_name = column_set.name
case column_set.column_indices.at i of
Nothing ->
typ = SQL_Type_Reference.from_constant SQL_Type.null
expr = SQL_Expression.Literal "NULL"
Internal_Column.Value column_name typ expr
null_column = Internal_Column.Value column_name typ expr
if cast_after_union then null_column else
## We assume that the type for this
expression will never be queried - it
is just used internally to build the
Union operation and never exposed
externally.
infer_return_type _ = SQL_Type_Reference.null
dialect.make_cast null_column result_type infer_return_type

corresponding_column_index : Integer ->
t.at corresponding_column_index . as_internal . rename column_name
pairs = columns_to_select.map c->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import project.Internal.Widget_Helpers
from project.Data.Table import print_table
from project.Data.Type.Value_Type import Value_Type, Auto
from project.Data.Type.Value_Type_Helpers import type_helpers
from project.Errors import No_Index_Set_Error, Floating_Point_Equality, Invalid_Value_Type
from project.Errors import No_Index_Set_Error, Floating_Point_Equality, Invalid_Value_Type, Inexact_Type_Coercion

polyglot java import org.enso.table.data.column.operation.map.MapOperationProblemBuilder
polyglot java import org.enso.table.data.column.storage.Storage as Java_Storage
Expand Down Expand Up @@ -647,7 +647,7 @@ type Column
type_helpers.check_argument_type self Value_Type.expect_boolean <|
common_type = type_helpers.find_common_type_for_arguments [when_true, when_false]
storage_type = Storage.from_value_type common_type Problem_Behavior.Report_Error
storage_type.catch Inexact_Type_Coercion error->
storage_type.catch Inexact_Type_Coercion _->
Panic.throw (Illegal_State.Error "Common type "+common_type.to_display_text+" is not supported by the Storage. This should never happen and is a bug in the Table library.")

storage_type.if_not_error <|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
import project.Data.Column.Column
import project.Data.Type.Enso_Types
from project.Data.Type.Value_Type import Value_Type, Auto
from project.Errors import Invalid_Value_Type
from project.Errors import Invalid_Value_Type, No_Common_Type

## PRIVATE
Finds a type that can fit both a current type and a new type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DoubleStorage(long[] data, int size, BitSet isMissing) {
public static DoubleStorage makeEmpty(int size) {
BitSet isMissing = new BitSet(size);
isMissing.set(0, size);
return new DoubleStorage(new long[0], size, new BitSet(size));
return new DoubleStorage(new long[0], size, isMissing);
}

/** @inheritDoc */
Expand Down

0 comments on commit 94b50ee

Please sign in to comment.