Skip to content

Conversation

@zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Mar 24, 2025

No description provided.

@Thearas
Copy link
Contributor

Thearas commented Mar 24, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

return new IcebergTransactionManager(ops);
}

public static TransactionManager createTrinoConnectorTransactionManager() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No one call this?

super();
}

public TrinoConnectorInsertCommandContext(Map<String, String> trinoConnectorOptions) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constructor is not used

));

// Set transaction flag
tTrinoConnectorTableSink.setUseTransaction(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is diff between true and false?

private void initConnector() {
String connectorName = trinoConnectorOptionParams.remove("connector.name");

TrinoConnectorCacheKey cacheKey = new TrinoConnectorCacheKey(catalogNameString, connectorName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think better use catalog id instead of createtime

LOG.error("Exception: " + stringWriter);
}

private String mapTrinoTypeToDorisType(String trinoType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about complex type?

} else if (trinoType.startsWith("varbinary")) {
return "BINARY";
} else {
return "VARCHAR";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to use varchar for all other types?

return status;
}

LOG(INFO) << "Successfully wrote " << num_rows << " rows to Trino connector";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug level

return status;
}

LOG(INFO) << "Successfully finished writing to Trino connector";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug

: AsyncResultWriter(output_exprs, dep, fin_dep) {
const TTrinoConnnectorTableSink& t_trino_sink = t_sink.trino_connector_table_sink;

// 收集列名和类型
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

return Status::OK();
}

Status VTrinoConnectorTableWriter::finish(RuntimeState* state) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some profile metric for these phases. like write, finish

std::unique_ptr<long[]> meta_data;
RETURN_IF_ERROR(JniConnector::to_java_table(block, meta_data));
long meta_address = (long)meta_data.get();
auto table_schema = JniConnector::parse_table_schema(block);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema 复用

return Status::OK();
}

Status JniConnector::_init_jni_writer(JNIEnv* env) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

拆分子类

ConnectorSession connectorSession = session.toConnectorSession(catalogHandle);
metadata = connector.getMetadata(connectorSession, connectorTransactionHandle);

insertTableHandle = metadata.beginInsert(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insertTableHandle 是否需要放到 FE

Objects.requireNonNull(connectorPageSinkProvider,
String.format("Connector '%s' returned a null page sink provider", catalogNameString));
} catch (UnsupportedOperationException e) {
LOG.debug("exception when getPageSinkProvider: {}", e.getMessage());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否 debug 日志?

new ConnectorPageSinkId() {
@Override
public long getId() {
return 0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 id 存疑?

String typeName = trinoType.getDisplayName();
BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(colIdx);

if (typeName.equals("boolean")) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 switch

@github-actions
Copy link
Contributor

We're closing this PR because it hasn't been updated in a while.
This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Nov 24, 2025
@github-actions github-actions bot closed this Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants