skorotkov commented on code in PR #11492:
URL: https://github.com/apache/ignite/pull/11492#discussion_r1747025095


##########
modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcClob.java:
##########
@@ -0,0 +1,292 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.jdbc2;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.Writer;
+import java.sql.Clob;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+/**
+ * CLOB implementation for Ignite JDBC driver.
+ */
+public class JdbcClob implements Clob {

Review Comment:
   I think it's not worth doing so for current basic and naive Clob support.
   
   Say postgres jdbc driver just doesn't support any methods to change the 
`Clob` object at all. The mysql jdbc driver does almost the same as we do here 
- it creates streams around the underlying string. Oracle possibly does 
something else but it has a real Clob support on protocol and storage level, 
which ignite doesn't.  In ignite Clob for now is just a thin wrapper around the 
Strings.
   
   General JDBC application wouldn't create a stream to **read** data from Clob 
from ResutSet and **change** it at the same time. 
   
   As far as the char[] implementation it would increase the memory usage in 
the "read" case. It would require the creation of extra char[] array in the 
ResultSet::getClob.  With current implementation just a string reference is 
passed and no extra memory is needed (especially if the get*Stream() APIs are 
used by the application).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to