-
Notifications
You must be signed in to change notification settings - Fork 6.2k
[WIP] dumpling: support export to parquet type #67846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -230,6 +230,15 @@ func (r *RowReceiverArr) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bo | |||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| func (r RowReceiverArr) GetRawBytes() []sql.RawBytes { | ||||||||||||||||||||||||||||||||||||
| rawBytes := make([]sql.RawBytes, len(r.receivers)) | ||||||||||||||||||||||||||||||||||||
| for i, receiver := range r.receivers { | ||||||||||||||||||||||||||||||||||||
| receiver.GetRawBytes() | ||||||||||||||||||||||||||||||||||||
| rawBytes[i] = receiver.GetRawBytes()[0] | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| return rawBytes | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+233
to
+240
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove redundant Line 236 invokes 🐛 Proposed fix-func (r RowReceiverArr) GetRawBytes() []sql.RawBytes {
- rawBytes := make([]sql.RawBytes, len(r.receivers))
- for i, receiver := range r.receivers {
- receiver.GetRawBytes()
- rawBytes[i] = receiver.GetRawBytes()[0]
- }
- return rawBytes
-}
+// GetRawBytes implements Stringer.GetRawBytes by collecting the first raw-bytes
+// element from each underlying receiver.
+func (r *RowReceiverArr) GetRawBytes() []sql.RawBytes {
+ rawBytes := make([]sql.RawBytes, len(r.receivers))
+ for i, receiver := range r.receivers {
+ rawBytes[i] = receiver.GetRawBytes()[0]
+ }
+ return rawBytes
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| // SQLTypeNumber implements RowReceiverStringer which represents numeric type columns in database | ||||||||||||||||||||||||||||||||||||
| type SQLTypeNumber struct { | ||||||||||||||||||||||||||||||||||||
| SQLTypeString | ||||||||||||||||||||||||||||||||||||
|
|
@@ -253,6 +262,10 @@ func (s SQLTypeNumber) WriteToBufferInCsv(bf *bytes.Buffer, _ bool, opt *csvOpti | |||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| func (s *SQLTypeNumber) GetRawBytes() []sql.RawBytes { | ||||||||||||||||||||||||||||||||||||
| return []sql.RawBytes{s.RawBytes} | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| // SQLTypeString implements RowReceiverStringer which represents string type columns in database | ||||||||||||||||||||||||||||||||||||
| type SQLTypeString struct { | ||||||||||||||||||||||||||||||||||||
| sql.RawBytes | ||||||||||||||||||||||||||||||||||||
|
|
@@ -285,6 +298,10 @@ func (s *SQLTypeString) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash boo | |||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| func (s *SQLTypeString) GetRawBytes() []sql.RawBytes { | ||||||||||||||||||||||||||||||||||||
| return []sql.RawBytes{s.RawBytes} | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| // SQLTypeBytes implements RowReceiverStringer which represents bytes type columns in database | ||||||||||||||||||||||||||||||||||||
| type SQLTypeBytes struct { | ||||||||||||||||||||||||||||||||||||
| sql.RawBytes | ||||||||||||||||||||||||||||||||||||
|
|
@@ -321,3 +338,7 @@ func (s *SQLTypeBytes) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool | |||||||||||||||||||||||||||||||||||
| bf.WriteString(opt.nullValue) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| func (s *SQLTypeBytes) GetRawBytes() []sql.RawBytes { | ||||||||||||||||||||||||||||||||||||
| return []sql.RawBytes{s.RawBytes} | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: pingcap/tidb
Length of output: 1415
🏁 Script executed:
Repository: pingcap/tidb
Length of output: 1441
🏁 Script executed:
Repository: pingcap/tidb
Length of output: 2363
Compile error:
storageis not imported.Line 858 references
storage.NoCompression, but this file does not import astoragepackage. It importscompressedio(line 20), andconf.CompressTypeis acompressedio.CompressType(line 146), so the check must usecompressedio.NoCompression. Note that there is a distinct localNoCompression ParquetCompressTypeconstant at line 221, but that's a different type.Fix
📝 Committable suggestion
🤖 Prompt for AI Agents