Fix Bug [Athena Datasource] datasource other params illegal (#13032)

This commit is contained in:
Jrebel-i 2023-03-30 16:15:29 +08:00 committed by zhuangchong
parent ecfdebebae
commit 3eeff662bc
2 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,7 @@ public abstract class AbstractDataSourceProcessor implements DataSourceProcessor
private static final Pattern DATABASE_PATTER = Pattern.compile("^[a-zA-Z0-9\\_\\-\\.]+$");
private static final Pattern PARAMS_PATTER = Pattern.compile("^[a-zA-Z0-9\\-\\_\\/\\@\\.]+$");
private static final Pattern PARAMS_PATTER = Pattern.compile("^[a-zA-Z0-9\\-\\_\\/\\@\\.\\:]+$");
private static final Set<String> POSSIBLE_MALICIOUS_KEYS = Sets.newHashSet("allowLoadLocalInfile");

View File

@ -49,6 +49,7 @@ public class AbstractDataSourceProcessorTest {
AbstractDataSourceProcessor mockDataSourceProcessor = mock(AbstractDataSourceProcessor.class);
Map<String, String> other = new HashMap<>();
other.put("allowLoadLocalInfile", "whatever");
other.put("OutputLocation", "s3://test-data-xini/athena-query");
doThrow(new IllegalArgumentException()).when(mockDataSourceProcessor).checkOther(other);
}
}