Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-thiel committed Oct 2, 2024
2 parents 7b44d31 + fd79c33 commit 0f44df7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
86 changes: 43 additions & 43 deletions crates/catalog/glue/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,82 +231,82 @@ mod tests {
"type": "struct",
"schema-id": 1,
"fields": [
{
"id": 0,
"name": "c0",
"required": true,
"type": "boolean"
},
{
"id": 1,
"name": "c1",
"required": true,
"type": "boolean"
"type": "int"
},
{
"id": 2,
"name": "c2",
"required": true,
"type": "int"
"type": "long"
},
{
"id": 3,
"name": "c3",
"required": true,
"type": "long"
"type": "float"
},
{
"id": 4,
"name": "c4",
"required": true,
"type": "float"
"type": "double"
},
{
"id": 5,
"name": "c5",
"required": true,
"type": "double"
"type": "decimal(2,2)"
},
{
"id": 6,
"name": "c6",
"required": true,
"type": "decimal(2,2)"
"type": "date"
},
{
"id": 7,
"name": "c7",
"required": true,
"type": "date"
"type": "time"
},
{
"id": 8,
"name": "c8",
"required": true,
"type": "time"
"type": "timestamp"
},
{
"id": 9,
"name": "c9",
"required": true,
"type": "timestamp"
"type": "string"
},
{
"id": 10,
"name": "c10",
"required": true,
"type": "string"
"type": "uuid"
},
{
"id": 11,
"name": "c11",
"required": true,
"type": "uuid"
"type": "fixed[4]"
},
{
"id": 12,
"name": "c12",
"required": true,
"type": "fixed[4]"
},
{
"id": 13,
"name": "c13",
"required": true,
"type": "binary"
}
]
Expand All @@ -318,19 +318,19 @@ mod tests {
let result = GlueSchemaBuilder::from_iceberg(&metadata)?.build();

let expected = vec![
create_column("c1", "boolean", "1")?,
create_column("c2", "int", "2")?,
create_column("c3", "bigint", "3")?,
create_column("c4", "float", "4")?,
create_column("c5", "double", "5")?,
create_column("c6", "decimal(2,2)", "6")?,
create_column("c7", "date", "7")?,
create_column("c8", "string", "8")?,
create_column("c9", "timestamp", "9")?,
create_column("c0", "boolean", "0")?,
create_column("c1", "int", "1")?,
create_column("c2", "bigint", "2")?,
create_column("c3", "float", "3")?,
create_column("c4", "double", "4")?,
create_column("c5", "decimal(2,2)", "5")?,
create_column("c6", "date", "6")?,
create_column("c7", "string", "7")?,
create_column("c8", "timestamp", "8")?,
create_column("c9", "string", "9")?,
create_column("c10", "string", "10")?,
create_column("c11", "string", "11")?,
create_column("c11", "binary", "11")?,
create_column("c12", "binary", "12")?,
create_column("c13", "binary", "13")?,
];

assert_eq!(result, expected);
Expand All @@ -345,20 +345,20 @@ mod tests {
"schema-id": 1,
"fields": [
{
"id": 1,
"id": 0,
"name": "person",
"required": true,
"type": {
"type": "struct",
"fields": [
{
"id": 2,
"id": 1,
"name": "name",
"required": true,
"type": "string"
},
{
"id": 3,
"id": 2,
"name": "age",
"required": false,
"type": "int"
Expand All @@ -377,7 +377,7 @@ mod tests {
let expected = vec![create_column(
"person",
"struct<name:string, age:int>",
"1",
"0",
)?];

assert_eq!(result, expected);
Expand All @@ -393,24 +393,24 @@ mod tests {
"type": "struct",
"fields": [
{
"id": 1,
"id": 0,
"name": "location",
"required": true,
"type": {
"type": "list",
"element-id": 2,
"element-id": 1,
"element-required": true,
"element": {
"type": "struct",
"fields": [
{
"id": 3,
"id": 2,
"name": "latitude",
"required": false,
"type": "float"
},
{
"id": 4,
"id": 3,
"name": "longitude",
"required": false,
"type": "float"
Expand All @@ -431,7 +431,7 @@ mod tests {
let expected = vec![create_column(
"location",
"array<struct<latitude:float, longitude:float>>",
"1",
"0",
)?];

assert_eq!(result, expected);
Expand All @@ -447,20 +447,20 @@ mod tests {
"type": "struct",
"fields": [
{
"id": 1,
"id": 0,
"name": "quux",
"required": true,
"type": {
"type": "map",
"key-id": 2,
"key-id": 1,
"key": "string",
"value-id": 3,
"value-id": 2,
"value-required": true,
"value": {
"type": "map",
"key-id": 4,
"key-id": 3,
"key": "string",
"value-id": 5,
"value-id": 4,
"value-required": true,
"value": "int"
}
Expand All @@ -475,7 +475,7 @@ mod tests {

let result = GlueSchemaBuilder::from_iceberg(&metadata)?.build();

let expected = vec![create_column("quux", "map<string,map<string,int>>", "1")?];
let expected = vec![create_column("quux", "map<string,map<string,int>>", "0")?];

assert_eq!(result, expected);

Expand Down
2 changes: 1 addition & 1 deletion crates/catalog/glue/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ mod tests {
let metadata = create_metadata(schema)?;

let parameters = HashMap::from([
(ICEBERG_FIELD_ID.to_string(), "1".to_string()),
(ICEBERG_FIELD_ID.to_string(), "0".to_string()),
(ICEBERG_FIELD_OPTIONAL.to_string(), "true".to_string()),
(ICEBERG_FIELD_CURRENT.to_string(), "true".to_string()),
]);
Expand Down
2 changes: 1 addition & 1 deletion crates/catalog/memory/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ mod tests {
fn simple_table_schema() -> Schema {
Schema::builder()
.with_fields(vec![NestedField::required(
1,
0,
"foo",
Type::Primitive(PrimitiveType::Int),
)
Expand Down

0 comments on commit 0f44df7

Please sign in to comment.