Skip to content

Commit 5e2ee1e

Browse files
committed
feat: add tinyint type to some files
Signed-off-by: Jeffrey <[email protected]>
1 parent e9accb3 commit 5e2ee1e

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

crates/proof-of-sql/benches/bench_append_rows.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use proof_of_sql::{
1212
commitment::TableCommitment,
1313
database::{
1414
owned_table_utility::{
15-
bigint, boolean, decimal75, int, int128, owned_table, scalar, smallint,
15+
bigint, boolean, decimal75, int, int128, owned_table, scalar, tinyint, smallint,
1616
timestamptz, varchar,
1717
},
1818
OwnedTable,
@@ -78,6 +78,7 @@ pub fn generate_random_owned_table<S: Scalar>(
7878
"scalar",
7979
"varchar",
8080
"decimal75",
81+
"tinyint",
8182
"smallint",
8283
"int",
8384
"timestamptz",
@@ -110,6 +111,10 @@ pub fn generate_random_owned_table<S: Scalar>(
110111
2,
111112
vec![generate_random_u64_array(); num_rows],
112113
)),
114+
"tinyint" => columns.push(tinyint(
115+
identifier.deref(),
116+
vec![rng.gen::<i8>(); num_rows],
117+
)),
113118
"smallint" => columns.push(smallint(
114119
identifier.deref(),
115120
vec![rng.gen::<i16>(); num_rows],

crates/proof-of-sql/src/base/database/filter_util.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pub fn filter_column_by_index<'a, S: Scalar>(
4141
Column::Boolean(col) => {
4242
Column::Boolean(alloc.alloc_slice_fill_iter(indexes.iter().map(|&i| col[i])))
4343
}
44+
Column::TinyInt(col) => {
45+
Column::TinyInt(alloc.alloc_slice_fill_iter(indexes.iter().map(|&i| col[i])))
46+
)
4447
Column::SmallInt(col) => {
4548
Column::SmallInt(alloc.alloc_slice_fill_iter(indexes.iter().map(|&i| col[i])))
4649
}

crates/proof-of-sql/src/sql/proof/provable_result_column.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ impl<S: Scalar> ProvableResultColumn for Column<'_, S> {
3535
fn num_bytes(&self, selection: &Indexes) -> usize {
3636
match self {
3737
Column::Boolean(col) => col.num_bytes(selection),
38+
Column::TinyInt(col) => col.num_bytes(selection),
3839
Column::SmallInt(col) => col.num_bytes(selection),
3940
Column::Int(col) => col.num_bytes(selection),
4041
Column::BigInt(col) => col.num_bytes(selection),
@@ -49,6 +50,7 @@ impl<S: Scalar> ProvableResultColumn for Column<'_, S> {
4950
fn write(&self, out: &mut [u8], selection: &Indexes) -> usize {
5051
match self {
5152
Column::Boolean(col) => col.write(out, selection),
53+
Column::TinyInt(col) => col.write(out, selection),
5254
Column::SmallInt(col) => col.write(out, selection),
5355
Column::Int(col) => col.write(out, selection),
5456
Column::BigInt(col) => col.write(out, selection),

0 commit comments

Comments
 (0)