]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
using the it.length() for segment processing. 55969/head
authorGal Salomon <gal.salomon@gmail.com>
Sun, 3 Mar 2024 12:44:49 +0000 (14:44 +0200)
committerGal Salomon <gal.salomon@gmail.com>
Tue, 5 Mar 2024 16:05:53 +0000 (18:05 +0200)
s3select submodule

Signed-off-by: Gal Salomon <gal.salomon@gmail.com>
(cherry picked from commit 8fedb30c1bd6cd393becf88f8d2fe07ea9c6040c)

src/rgw/rgw_s3select.cc
src/s3select

index 7ca1f239e976dc896f52067e495ee3d2e9920091..4080d0938954b6718ced2f985af8ad94de578503 100644 (file)
@@ -408,7 +408,7 @@ int RGWSelectObj_ObjStore_S3::run_s3select_on_csv(const char* query, const char*
   } else if(m_header_info.compare("USE")==0) {
     csv.use_header_info=true;
   }
-  //m_s3_csv_object.set_external_debug_system(fp_debug_mesg);
+  m_s3_csv_object.set_external_debug_system(fp_debug_mesg);
   m_s3_csv_object.set_result_formatters(fp_s3select_result_format,fp_result_header_format);
   m_s3_csv_object.set_csv_query(&s3select_syntax, csv);
   if (s3select_syntax.get_error_description().empty() == false) {
@@ -863,20 +863,23 @@ int RGWSelectObj_ObjStore_S3::csv_processing(bufferlist& bl, off_t ofs, off_t le
         continue;
       }
 
-      if((ofs + len) > it.length()){
+
+      if(ofs > it.length()){
+      //safety check
        ldpp_dout(this, 10) << "offset and length may cause invalid read: ofs = " << ofs << " len = " << len << " it.length() = " << it.length() << dendl;
        ofs = 0;
-       len = it.length();
       }
 
     if(m_is_trino_request){
+      //TODO replace len with it.length() ? ; test Trino flow with compressed objects.
+      //is it possible to send get-by-ranges? in parallel?
       shape_chunk_per_trino_requests(&(it)[0], ofs, len); 
     }
 
     ldpp_dout(this, 10) << "s3select: chunk:  ofs = " << ofs << " len = " << len << " it.length() = " << it.length() << " m_object_size_for_processing = " << m_object_size_for_processing << dendl;
     
     m_aws_response_handler.update_processed_size(it.length());//NOTE : to run analysis to validate len is aligned with m_processed_bytes
-    status = run_s3select_on_csv(m_sql_query.c_str(), &(it)[0] + ofs, len);
+    status = run_s3select_on_csv(m_sql_query.c_str(), &(it)[0] + ofs, it.length());
     if (status<0) {
          return -EINVAL;
     }
index 071146cf108d84119e4cd825834fd00f14b83497..232ac7061ec3ab52fb4a76264a11e3c23af2972d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 071146cf108d84119e4cd825834fd00f14b83497
+Subproject commit 232ac7061ec3ab52fb4a76264a11e3c23af2972d