Skip to content

Conversation

@AbhishekKumar9984
Copy link

adding new property TableName in the ui and its functionality i.e now user can get reterive the data from giving tablename without providing the import query.

return fieldDescriptors;
}

public List<SnowflakeFieldDescriptor> describeTable(String schemaName, String tableName) throws SQLException {

Choose a reason for hiding this comment

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

Add Javadoc for public methods

}
}

public String getSchema() {

Choose a reason for hiding this comment

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

Add javadoc here as well

String copy = String.format(COMAND_COPY_INTO, QueryUtil.removeSemicolon(config.getImportQuery()));
String importQuery = config.getImportQuery();
if (Strings.isNullOrEmpty(importQuery)) {
importQuery = "SELECT * FROM " + config.getTableName();

Choose a reason for hiding this comment

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

It's better to use String.format method


SnowflakeBatchSourceConfig mockConfig = Mockito.mock(SnowflakeBatchSourceConfig.class);
Mockito.when(mockConfig.getSchema()).thenReturn("{}");
// SchemaHelper.getSchema(null, "{}", collector, null);

Choose a reason for hiding this comment

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

Remove comments

Copy link
Author

Choose a reason for hiding this comment

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

i think its better to not remove the comments it will help other developer to easily see what changes i had made to the particular line of code.

import java.io.FileWriter;
import java.io.IOException;
import java.lang.reflect.Field;
//import java.sql.*;

Choose a reason for hiding this comment

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

Remove comments

* A class which will help in connection
*/

public void runSQL(String query) {

Choose a reason for hiding this comment

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

Remove javadoc


public LoadUnloadConfig(String accountName, String database,
String schemaName, String username, String password,
String schemaName, String tableName, String username, String password,

Choose a reason for hiding this comment

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

tableName is not required here!

@Macro
private String schemaName;

@Name(PROPERTY_TABLE_NAME)

Choose a reason for hiding this comment

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

Table Name should be moved under Basic section using widgets.json

private String pattern;

public LoadActionConfig(String accountName, String database, String schemaName, String username, String password,
public LoadActionConfig(String accountName, String database, String schemaName, String tableName,

Choose a reason for hiding this comment

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

tableName not required here as well

}

public static Schema getSchema(SnowflakeAccessor snowflakeAccessor, String schemaName,
public static Schema getSchema(SnowflakeAccessor snowflakeAccessor,

Choose a reason for hiding this comment

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

The getSchema method used within the SchemaHelper class only should be made private

}

SnowflakeAccessor snowflakeAccessor = new SnowflakeAccessor(this);
// Schema expectedSchema = SchemaHelper.getSchema(snowflakeAccessor, String.format(GET_FIELDS_QUERY, tableName));

Choose a reason for hiding this comment

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

Remove comments

Schema actual = SchemaHelper.getSchema(mockConfig, collector);
// SnowflakeBatchSourceConfig mockConfig = Mockito.mock(SnowflakeBatchSourceConfig.class);
// Mockito.when(mockConfig.canConnect()).thenReturn(false);
// Mockito.when(mockConfig.getSchema()).thenReturn(expected.toString());

Choose a reason for hiding this comment

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

Remove comments

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

Successfully merging this pull request may close these issues.

2 participants