[
https://issues.apache.org/jira/browse/CASSANDRA-17181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17458378#comment-17458378
]
Bartlomiej commented on CASSANDRA-17181:
----------------------------------------
Hi :)
I added comments you suggested (honestly I am not sure my comments make sense
:D )
{code:java}
@VisibleForTesting
public static String getTableMetadataAsCQL(TableMetadata metadata)
{
if (metadata.isView())
{
KeyspaceMetadata keyspaceMetadata =
Schema.instance.getKeyspaceMetadata(metadata.keyspace);
ViewMetadata viewMetadata =
keyspaceMetadata.views.get(metadata.name).orElse(null);
assert viewMetadata != null;
/*
* first argument(withInternals) indicates to include table metadata id
and clustering columns order,
* second argument(ifNotExists) instructs to include IF NOT EXISTS
statement withing creation statements.
*/
return viewMetadata.toCqlString(true, true);
}
/*
* With addition to withInternals and ifNotExists argruments,
includeDroppedColumns will include dropped
* columns as ALTER TABLE statements appended into the snapshot.
*/
return metadata.toCqlString(true, true, true);
} {code}
If you have any hints here, pls say.
{quote}
if a branch or a PR in your fork is more convenient
{quote}
sure, next time I will make a PR.
> SchemaCQLHelperTest methods can be simplified
> ---------------------------------------------
>
> Key: CASSANDRA-17181
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17181
> Project: Cassandra
> Issue Type: Improvement
> Components: Local/Snapshots
> Reporter: Benjamin Lerer
> Assignee: Bartlomiej
> Priority: Normal
> Labels: AdventCalendar2021, lhf
> Fix For: 4.0.x, 4.x
>
>
> {{SchemaCQLHelperTest}} is used during a snapshot to generate the
> {{schema.cql}} file. The methods accept the following paramaters:
> {{includeDroppedColumns}}, {{internals}} and {{ifNotExists}}.
> Those parameters are in practice always set to true by the calling code and
> therefore can be removed.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]