Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions meta/src/meta/grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ def default_configure() -> transactions.Configure:
return transactions.Configure(
semantics_version=0,
ivm_config=ivm_config,
optimization_level=transactions.OptimizationLevel.OPTIMIZATION_LEVEL_DEFAULT,
)

def construct_configure(config_dict: Sequence[Tuple[String, logic.Value]]) -> transactions.Configure:
Expand All @@ -1332,9 +1333,24 @@ def construct_configure(config_dict: Sequence[Tuple[String, logic.Value]]) -> tr
maintenance_level = transactions.MaintenanceLevel.MAINTENANCE_LEVEL_OFF
ivm_config: transactions.IVMConfig = transactions.IVMConfig(level=maintenance_level)
semantics_version: int = _extract_value_int64(builtin.dict_get(config, "semantics_version"), 0)

optimization_level_val: Optional[logic.Value] = builtin.dict_get(config, "optimization_level")
optimization_level: transactions.OptimizationLevel = transactions.OptimizationLevel.OPTIMIZATION_LEVEL_DEFAULT
if (optimization_level_val is not None
and builtin.has_proto_field(optimization_level_val, 'string_value')):
if optimization_level_val.string_value == "default":
optimization_level = transactions.OptimizationLevel.OPTIMIZATION_LEVEL_DEFAULT
elif optimization_level_val.string_value == "conservative":
optimization_level = transactions.OptimizationLevel.OPTIMIZATION_LEVEL_CONSERVATIVE
elif optimization_level_val.string_value == "aggressive":
optimization_level = transactions.OptimizationLevel.OPTIMIZATION_LEVEL_AGGRESSIVE
else:
optimization_level = transactions.OptimizationLevel.OPTIMIZATION_LEVEL_DEFAULT

return transactions.Configure(
semantics_version=semantics_version,
ivm_config=ivm_config,
optimization_level=optimization_level,
)

def construct_export_csv_config(
Expand Down Expand Up @@ -1414,6 +1430,12 @@ def deconstruct_configure(msg: transactions.Configure) -> List[Tuple[String, log
builtin.list_push(result, builtin.tuple("ivm.maintenance_level", _make_value_string("all")))
elif msg.ivm_config.level == transactions.MaintenanceLevel.MAINTENANCE_LEVEL_OFF:
builtin.list_push(result, builtin.tuple("ivm.maintenance_level", _make_value_string("off")))
if msg.optimization_level == transactions.OptimizationLevel.OPTIMIZATION_LEVEL_DEFAULT:
builtin.list_push(result, builtin.tuple("optimization_level", _make_value_string("default")))
elif msg.optimization_level == transactions.OptimizationLevel.OPTIMIZATION_LEVEL_CONSERVATIVE:
builtin.list_push(result, builtin.tuple("optimization_level", _make_value_string("conservative")))
elif msg.optimization_level == transactions.OptimizationLevel.OPTIMIZATION_LEVEL_AGGRESSIVE:
builtin.list_push(result, builtin.tuple("optimization_level", _make_value_string("aggressive")))
builtin.list_push(result, builtin.tuple("semantics_version", _make_value_int64(msg.semantics_version)))
return builtin.list_sort(result)

Expand Down
8 changes: 8 additions & 0 deletions proto/relationalai/lqp/v1/transactions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ message Transaction {
message Configure {
int64 semantics_version = 1;
IVMConfig ivm_config = 2;
OptimizationLevel optimization_level = 3;
}

message IVMConfig {
Expand All @@ -29,6 +30,13 @@ enum MaintenanceLevel {
MAINTENANCE_LEVEL_ALL = 3;
}

enum OptimizationLevel {
OPTIMIZATION_LEVEL_UNSPECIFIED = 0;
OPTIMIZATION_LEVEL_DEFAULT = 1;
OPTIMIZATION_LEVEL_CONSERVATIVE = 2;
OPTIMIZATION_LEVEL_AGGRESSIVE = 3;
}

message Sync {
repeated FragmentId fragments = 1;
}
Expand Down
600 changes: 339 additions & 261 deletions sdks/go/src/lqp/v1/transactions.pb.go

Large diffs are not rendered by default.

21 changes: 19 additions & 2 deletions sdks/go/src/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ func (p *Parser) construct_betree_info(key_types []*pb.Type, value_types []*pb.T
func (p *Parser) default_configure() *pb.Configure {
_t1856 := &pb.IVMConfig{Level: pb.MaintenanceLevel_MAINTENANCE_LEVEL_OFF}
ivm_config := _t1856
_t1857 := &pb.Configure{SemanticsVersion: 0, IvmConfig: ivm_config}
_t1857 := &pb.Configure{SemanticsVersion: 0, IvmConfig: ivm_config, OptimizationLevel: pb.OptimizationLevel_OPTIMIZATION_LEVEL_DEFAULT}
return _t1857
}

Expand All @@ -802,7 +802,24 @@ func (p *Parser) construct_configure(config_dict [][]interface{}) *pb.Configure
ivm_config := _t1858
_t1859 := p._extract_value_int64(dictGetValue(config, "semantics_version"), 0)
semantics_version := _t1859
_t1860 := &pb.Configure{SemanticsVersion: semantics_version, IvmConfig: ivm_config}
optimization_level_val := dictGetValue(config, "optimization_level")
optimization_level := pb.OptimizationLevel_OPTIMIZATION_LEVEL_DEFAULT
if (optimization_level_val != nil && hasProtoField(optimization_level_val, "string_value")) {
if optimization_level_val.GetStringValue() == "default" {
optimization_level = pb.OptimizationLevel_OPTIMIZATION_LEVEL_DEFAULT
} else {
if optimization_level_val.GetStringValue() == "conservative" {
optimization_level = pb.OptimizationLevel_OPTIMIZATION_LEVEL_CONSERVATIVE
} else {
if optimization_level_val.GetStringValue() == "aggressive" {
optimization_level = pb.OptimizationLevel_OPTIMIZATION_LEVEL_AGGRESSIVE
} else {
optimization_level = pb.OptimizationLevel_OPTIMIZATION_LEVEL_DEFAULT
}
}
}
}
_t1860 := &pb.Configure{SemanticsVersion: semantics_version, IvmConfig: ivm_config, OptimizationLevel: optimization_level}
return _t1860
}

Expand Down
159 changes: 97 additions & 62 deletions sdks/go/src/pretty.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,106 +363,120 @@ func (p *PrettyPrinter) deconstruct_configure(msg *pb.Configure) [][]interface{}
}
}
}
_t1468 := p._make_value_int64(msg.GetSemanticsVersion())
result = append(result, []interface{}{"semantics_version", _t1468})
if msg.GetOptimizationLevel() == pb.OptimizationLevel_OPTIMIZATION_LEVEL_DEFAULT {
_t1468 := p._make_value_string("default")
result = append(result, []interface{}{"optimization_level", _t1468})
} else {
if msg.GetOptimizationLevel() == pb.OptimizationLevel_OPTIMIZATION_LEVEL_CONSERVATIVE {
_t1469 := p._make_value_string("conservative")
result = append(result, []interface{}{"optimization_level", _t1469})
} else {
if msg.GetOptimizationLevel() == pb.OptimizationLevel_OPTIMIZATION_LEVEL_AGGRESSIVE {
_t1470 := p._make_value_string("aggressive")
result = append(result, []interface{}{"optimization_level", _t1470})
}
}
}
_t1471 := p._make_value_int64(msg.GetSemanticsVersion())
result = append(result, []interface{}{"semantics_version", _t1471})
return listSort(result)
}

func (p *PrettyPrinter) deconstruct_csv_config(msg *pb.CSVConfig) [][]interface{} {
result := [][]interface{}{}
_t1469 := p._make_value_int32(msg.GetHeaderRow())
result = append(result, []interface{}{"csv_header_row", _t1469})
_t1470 := p._make_value_int64(msg.GetSkip())
result = append(result, []interface{}{"csv_skip", _t1470})
_t1472 := p._make_value_int32(msg.GetHeaderRow())
result = append(result, []interface{}{"csv_header_row", _t1472})
_t1473 := p._make_value_int64(msg.GetSkip())
result = append(result, []interface{}{"csv_skip", _t1473})
if msg.GetNewLine() != "" {
_t1471 := p._make_value_string(msg.GetNewLine())
result = append(result, []interface{}{"csv_new_line", _t1471})
}
_t1472 := p._make_value_string(msg.GetDelimiter())
result = append(result, []interface{}{"csv_delimiter", _t1472})
_t1473 := p._make_value_string(msg.GetQuotechar())
result = append(result, []interface{}{"csv_quotechar", _t1473})
_t1474 := p._make_value_string(msg.GetEscapechar())
result = append(result, []interface{}{"csv_escapechar", _t1474})
_t1474 := p._make_value_string(msg.GetNewLine())
result = append(result, []interface{}{"csv_new_line", _t1474})
}
_t1475 := p._make_value_string(msg.GetDelimiter())
result = append(result, []interface{}{"csv_delimiter", _t1475})
_t1476 := p._make_value_string(msg.GetQuotechar())
result = append(result, []interface{}{"csv_quotechar", _t1476})
_t1477 := p._make_value_string(msg.GetEscapechar())
result = append(result, []interface{}{"csv_escapechar", _t1477})
if msg.GetComment() != "" {
_t1475 := p._make_value_string(msg.GetComment())
result = append(result, []interface{}{"csv_comment", _t1475})
_t1478 := p._make_value_string(msg.GetComment())
result = append(result, []interface{}{"csv_comment", _t1478})
}
for _, missing_string := range msg.GetMissingStrings() {
_t1476 := p._make_value_string(missing_string)
result = append(result, []interface{}{"csv_missing_strings", _t1476})
}
_t1477 := p._make_value_string(msg.GetDecimalSeparator())
result = append(result, []interface{}{"csv_decimal_separator", _t1477})
_t1478 := p._make_value_string(msg.GetEncoding())
result = append(result, []interface{}{"csv_encoding", _t1478})
_t1479 := p._make_value_string(msg.GetCompression())
result = append(result, []interface{}{"csv_compression", _t1479})
_t1479 := p._make_value_string(missing_string)
result = append(result, []interface{}{"csv_missing_strings", _t1479})
}
_t1480 := p._make_value_string(msg.GetDecimalSeparator())
result = append(result, []interface{}{"csv_decimal_separator", _t1480})
_t1481 := p._make_value_string(msg.GetEncoding())
result = append(result, []interface{}{"csv_encoding", _t1481})
_t1482 := p._make_value_string(msg.GetCompression())
result = append(result, []interface{}{"csv_compression", _t1482})
if msg.GetPartitionSizeMb() != 0 {
_t1480 := p._make_value_int64(msg.GetPartitionSizeMb())
result = append(result, []interface{}{"csv_partition_size_mb", _t1480})
_t1483 := p._make_value_int64(msg.GetPartitionSizeMb())
result = append(result, []interface{}{"csv_partition_size_mb", _t1483})
}
return listSort(result)
}

func (p *PrettyPrinter) deconstruct_betree_info_config(msg *pb.BeTreeInfo) [][]interface{} {
result := [][]interface{}{}
_t1481 := p._make_value_float64(msg.GetStorageConfig().GetEpsilon())
result = append(result, []interface{}{"betree_config_epsilon", _t1481})
_t1482 := p._make_value_int64(msg.GetStorageConfig().GetMaxPivots())
result = append(result, []interface{}{"betree_config_max_pivots", _t1482})
_t1483 := p._make_value_int64(msg.GetStorageConfig().GetMaxDeltas())
result = append(result, []interface{}{"betree_config_max_deltas", _t1483})
_t1484 := p._make_value_int64(msg.GetStorageConfig().GetMaxLeaf())
result = append(result, []interface{}{"betree_config_max_leaf", _t1484})
_t1484 := p._make_value_float64(msg.GetStorageConfig().GetEpsilon())
result = append(result, []interface{}{"betree_config_epsilon", _t1484})
_t1485 := p._make_value_int64(msg.GetStorageConfig().GetMaxPivots())
result = append(result, []interface{}{"betree_config_max_pivots", _t1485})
_t1486 := p._make_value_int64(msg.GetStorageConfig().GetMaxDeltas())
result = append(result, []interface{}{"betree_config_max_deltas", _t1486})
_t1487 := p._make_value_int64(msg.GetStorageConfig().GetMaxLeaf())
result = append(result, []interface{}{"betree_config_max_leaf", _t1487})
if hasProtoField(msg.GetRelationLocator(), "root_pageid") {
if msg.GetRelationLocator().GetRootPageid() != nil {
_t1485 := p._make_value_uint128(msg.GetRelationLocator().GetRootPageid())
result = append(result, []interface{}{"betree_locator_root_pageid", _t1485})
_t1488 := p._make_value_uint128(msg.GetRelationLocator().GetRootPageid())
result = append(result, []interface{}{"betree_locator_root_pageid", _t1488})
}
}
if hasProtoField(msg.GetRelationLocator(), "inline_data") {
if msg.GetRelationLocator().GetInlineData() != nil {
_t1486 := p._make_value_string(string(msg.GetRelationLocator().GetInlineData()))
result = append(result, []interface{}{"betree_locator_inline_data", _t1486})
_t1489 := p._make_value_string(string(msg.GetRelationLocator().GetInlineData()))
result = append(result, []interface{}{"betree_locator_inline_data", _t1489})
}
}
_t1487 := p._make_value_int64(msg.GetRelationLocator().GetElementCount())
result = append(result, []interface{}{"betree_locator_element_count", _t1487})
_t1488 := p._make_value_int64(msg.GetRelationLocator().GetTreeHeight())
result = append(result, []interface{}{"betree_locator_tree_height", _t1488})
_t1490 := p._make_value_int64(msg.GetRelationLocator().GetElementCount())
result = append(result, []interface{}{"betree_locator_element_count", _t1490})
_t1491 := p._make_value_int64(msg.GetRelationLocator().GetTreeHeight())
result = append(result, []interface{}{"betree_locator_tree_height", _t1491})
return listSort(result)
}

func (p *PrettyPrinter) deconstruct_export_csv_config(msg *pb.ExportCSVConfig) [][]interface{} {
result := [][]interface{}{}
if msg.PartitionSize != nil {
_t1489 := p._make_value_int64(*msg.PartitionSize)
result = append(result, []interface{}{"partition_size", _t1489})
_t1492 := p._make_value_int64(*msg.PartitionSize)
result = append(result, []interface{}{"partition_size", _t1492})
}
if msg.Compression != nil {
_t1490 := p._make_value_string(*msg.Compression)
result = append(result, []interface{}{"compression", _t1490})
_t1493 := p._make_value_string(*msg.Compression)
result = append(result, []interface{}{"compression", _t1493})
}
if msg.SyntaxHeaderRow != nil {
_t1491 := p._make_value_boolean(*msg.SyntaxHeaderRow)
result = append(result, []interface{}{"syntax_header_row", _t1491})
_t1494 := p._make_value_boolean(*msg.SyntaxHeaderRow)
result = append(result, []interface{}{"syntax_header_row", _t1494})
}
if msg.SyntaxMissingString != nil {
_t1492 := p._make_value_string(*msg.SyntaxMissingString)
result = append(result, []interface{}{"syntax_missing_string", _t1492})
_t1495 := p._make_value_string(*msg.SyntaxMissingString)
result = append(result, []interface{}{"syntax_missing_string", _t1495})
}
if msg.SyntaxDelim != nil {
_t1493 := p._make_value_string(*msg.SyntaxDelim)
result = append(result, []interface{}{"syntax_delim", _t1493})
_t1496 := p._make_value_string(*msg.SyntaxDelim)
result = append(result, []interface{}{"syntax_delim", _t1496})
}
if msg.SyntaxQuotechar != nil {
_t1494 := p._make_value_string(*msg.SyntaxQuotechar)
result = append(result, []interface{}{"syntax_quotechar", _t1494})
_t1497 := p._make_value_string(*msg.SyntaxQuotechar)
result = append(result, []interface{}{"syntax_quotechar", _t1497})
}
if msg.SyntaxEscapechar != nil {
_t1495 := p._make_value_string(*msg.SyntaxEscapechar)
result = append(result, []interface{}{"syntax_escapechar", _t1495})
_t1498 := p._make_value_string(*msg.SyntaxEscapechar)
result = append(result, []interface{}{"syntax_escapechar", _t1498})
}
return listSort(result)
}
Expand All @@ -474,11 +488,11 @@ func (p *PrettyPrinter) deconstruct_relation_id_string(msg *pb.RelationId) strin

func (p *PrettyPrinter) deconstruct_relation_id_uint128(msg *pb.RelationId) *pb.UInt128Value {
name := p.relationIdToString(msg)
var _t1496 interface{}
var _t1499 interface{}
if name == nil {
return p.relationIdToUint128(msg)
}
_ = _t1496
_ = _t1499
return nil
}

Expand Down Expand Up @@ -4194,8 +4208,8 @@ func (p *PrettyPrinter) pretty_debug_info(msg *pb.DebugInfo) interface{} {
for _idx, _rid := range msg.GetIds() {
p.newline()
p.write("(")
_t1497 := &pb.UInt128Value{Low: _rid.GetIdLow(), High: _rid.GetIdHigh()}
p.pprintDispatch(_t1497)
_t1500 := &pb.UInt128Value{Low: _rid.GetIdLow(), High: _rid.GetIdHigh()}
p.pprintDispatch(_t1500)
p.write(" ")
p.write(p.formatStringValue(msg.GetOrigNames()[_idx]))
p.write(")")
Expand Down Expand Up @@ -4353,6 +4367,25 @@ func (p *PrettyPrinter) pretty_maintenance_level(x pb.MaintenanceLevel) interfac
return nil
}

func (p *PrettyPrinter) pretty_optimization_level(x pb.OptimizationLevel) interface{} {
if x == pb.OptimizationLevel_OPTIMIZATION_LEVEL_UNSPECIFIED {
p.write("unspecified")
} else {
if x == pb.OptimizationLevel_OPTIMIZATION_LEVEL_DEFAULT {
p.write("default")
} else {
if x == pb.OptimizationLevel_OPTIMIZATION_LEVEL_CONSERVATIVE {
p.write("conservative")
} else {
if x == pb.OptimizationLevel_OPTIMIZATION_LEVEL_AGGRESSIVE {
p.write("aggressive")
}
}
}
}
return nil
}

// --- Dispatch function ---
func (p *PrettyPrinter) pprintDispatch(msg interface{}) {
switch m := msg.(type) {
Expand Down Expand Up @@ -4578,6 +4611,8 @@ func (p *PrettyPrinter) pprintDispatch(msg interface{}) {
p.pretty_ivm_config(m)
case pb.MaintenanceLevel:
p.pretty_maintenance_level(m)
case pb.OptimizationLevel:
p.pretty_optimization_level(m)
default:
panic(fmt.Sprintf("no pretty printer for %T", msg))
}
Expand Down
Loading
Loading