Changeset: de4c63ff07ec for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/de4c63ff07ec
Modified Files:
        sql/backends/monet5/vaults/parquet/pqc_reader.c
        sql/backends/monet5/vaults/parquet/pqc_thrift.h
Branch: pp_hashjoin
Log Message:

fixing byte array for big endianness


diffs (50 lines):

diff --git a/sql/backends/monet5/vaults/parquet/pqc_reader.c 
b/sql/backends/monet5/vaults/parquet/pqc_reader.c
--- a/sql/backends/monet5/vaults/parquet/pqc_reader.c
+++ b/sql/backends/monet5/vaults/parquet/pqc_reader.c
@@ -2055,12 +2055,12 @@ pqc_read_chunk( pqc_reader_t *r, int wnr
                                                                char *dst = 
output;
                                                                /* FIXED ARRAY 
little endian len followed by big endian data,  what where they smoking */
                                                                for (uint32_t i 
= 0; i < nrows; i++, dst += 2) {
-                                                                       int len 
= *(int*)(((char*)cr->data)+pos);
+                                                                       int len 
= pqc_int(*(int*)(((char*)cr->data)+pos));
                                                                        pos += 
4;
                                                                        
*(sht*)dst = 0;
                                                                        
memcpy(dst, ((char*)cr->data)+pos, len);
                                                                        if (len 
== 2)
-                                                                               
*(sht*)dst = short_int_SWAP(*(sht*)dst);
+                                                                               
*(sht*)dst = pqc_be_sht(*(sht*)dst);
                                                                        pos += 
len;
                                                                }
                                                        }
@@ -2234,12 +2234,12 @@ pqc_read_chunk( pqc_reader_t *r, int wnr
                                                                char *dst = 
output;
                                                                /* FIXED ARRAY 
little endian len followed by big endian data,  what where they smoking */
                                                                for (uint32_t i 
= 0; i < nrows; i++, dst += 2) {
-                                                                       int len 
= *(int*)(((char*)cr->data)+pos);
+                                                                       int len 
= pqc_int(*(int*)(((char*)cr->data)+pos));
                                                                        pos += 
4;
                                                                        
*(sht*)dst = 0;
                                                                        
memcpy(dst, ((char*)cr->data)+pos, len);
                                                                        if (len 
== 2)
-                                                                               
*(sht*)dst = short_int_SWAP(*(sht*)dst);
+                                                                               
*(sht*)dst = pqc_be_sht(*(sht*)dst);
                                                                        pos += 
len;
                                                                }
                                                        }
diff --git a/sql/backends/monet5/vaults/parquet/pqc_thrift.h 
b/sql/backends/monet5/vaults/parquet/pqc_thrift.h
--- a/sql/backends/monet5/vaults/parquet/pqc_thrift.h
+++ b/sql/backends/monet5/vaults/parquet/pqc_thrift.h
@@ -108,11 +108,13 @@ pqc_export int pqc_get_string( char *in,
 #define pqc_int(s) normal_int_SWAP(s)
 #define pqc_lng(s) long_int_SWAP(s)
 #define pqc_hge(s) huge_int_SWAP(s)
+#define pqc_be_sht(s) (s)
 #else
 #define pqc_sht(s) (s)
 #define pqc_int(s) (s)
 #define pqc_lng(s) (s)
 #define pqc_hge(s) (s)
+#define pqc_be_sht(s) short_int_SWAP(s)
 #endif
 
 #endif /*_PQC_THRIFT_H_*/
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to