Skip to content
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

How to decrease memory usage when read orc file #69

Open
ggchangan opened this issue Sep 29, 2021 · 0 comments
Open

How to decrease memory usage when read orc file #69

ggchangan opened this issue Sep 29, 2021 · 0 comments

Comments

@ggchangan
Copy link

I read an ORC file using code much like this:

	cursor := reader.Select(readColumns...)
	defer cursor.Close()
	err = cursor.PrepareStripe(sr.StripeObject.StripeIndex)
	for cursor.Next() {
		row0 := cursor.Row()
		row := make([]driver.Value, len(dataBlock.Columns.Columns))
		for i := range row0 {
			row[i] = driver.Value(row0[i])
		}
		for i, j := len(row0), 0; j < len(sr.StripeObject.ExtraValues); i, j = i+1, j+1 {
			row[i] = driver.Value(sr.StripeObject.ExtraValues[j])
		}
		dataBlock.Payload = append(dataBlock.Payload, row

I try to build a dataBlock with 20000 rows and then insert this dataBlock to ClickHouse, However this process consume too much memory. So is there any way which can be used to decrease memory usage when read orc file to build dataBlock?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant