Skip to content

Commit

Permalink
Merge pull request #525 from project-tsurugi/amend
Browse files Browse the repository at this point in the history
update sql proto. files to be the same as jogasaki
  • Loading branch information
t-horikawa authored Feb 10, 2025
2 parents 3a66976 + 160cf85 commit 9a280ba
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
24 changes: 14 additions & 10 deletions modules/proto/src/main/protos/jogasaki/proto/sql/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -211,28 +211,32 @@ message DateTimeInterval {
// the character large object value.
message Clob {

// the channel name to transfer this large object data.
string channel_name = 1;

// the data of this large object.
oneof data {
// the object value is stored in the file (don't across the network, only for used in the local system).
string local_path = 1;

// the channel name to transmit this object value.
string channel_name = 2;

// absolute path of the large object data on the local file system (only for privileged mode)
string local_path = 2;
// the immediate object value (for small objects).
bytes contents = 3;
}
}

// the binary large object value.
message Blob {

// the channel name to transfer this large object data.
string channel_name = 1;

// the data of this large object.
oneof data {
// the object value is stored in the file (don't across the network, only for used in the local system).
string local_path = 1;

// the channel name to transmit this object value.
string channel_name = 2;

// absolute path of the large object data on the local file system (only for privileged mode)
string local_path = 2;
// the immediate object value (for small objects).
bytes contents = 3;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,14 @@ message GetLargeObjectData {
// request is successfully completed.
message Success {

// the data channel name of retrieved large object data.
string channel_name = 1;
// the data of this large object.
oneof data {
// the data channel name of retrieved large object data.
string channel_name = 1;

// the immediate object value (for small objects).
bytes contents = 2;
}
}

reserved 1 to 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ private SqlRequest.Parameter addLob(SqlRequest.Parameter e, LinkedList<BlobInfo>
throw new IllegalArgumentException();
}
return SqlRequest.Parameter.newBuilder()
.setClob(SqlCommon.Clob.newBuilder()
.setChannelName(channelName)
.build())
.setClob(SqlCommon.Clob.newBuilder()
.setChannelName(channelName)
.build())
.build();
case CONTENTS:
return e;
default:
throw new UnsupportedOperationException();
throw new IllegalArgumentException();
}

}
if (e.getValueCase() == SqlRequest.Parameter.ValueCase.BLOB) {
} else if (e.getValueCase() == SqlRequest.Parameter.ValueCase.BLOB) {
var v = e.getBlob();
switch (v.getDataCase()) {
case LOCAL_PATH:
Expand All @@ -190,12 +190,14 @@ private SqlRequest.Parameter addLob(SqlRequest.Parameter e, LinkedList<BlobInfo>
throw new IllegalArgumentException();
}
return SqlRequest.Parameter.newBuilder()
.setBlob(SqlCommon.Blob.newBuilder()
.setChannelName(channelName)
.build())
.setBlob(SqlCommon.Blob.newBuilder()
.setChannelName(channelName)
.build())
.build();
case CONTENTS:
return e;
default:
throw new UnsupportedOperationException();
throw new IllegalArgumentException();
}
}
return e;
Expand Down

0 comments on commit 9a280ba

Please sign in to comment.