Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
449f5f89
Commit
449f5f89
authored
8 years ago
by
Adam Welc
Browse files
Options
Downloads
Patches
Plain Diff
Partially reverted previous rewrite of parameter casts for readdDCF builtin.
parent
a7cc6876
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ReadDCF.java
+11
-6
11 additions, 6 deletions
.../src/com/oracle/truffle/r/nodes/builtin/base/ReadDCF.java
with
11 additions
and
6 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ReadDCF.java
+
11
−
6
View file @
449f5f89
...
...
@@ -22,7 +22,6 @@
*/
package
com.oracle.truffle.r.nodes.builtin.base
;
import
static
com
.
oracle
.
truffle
.
r
.
nodes
.
builtin
.
CastBuilder
.
Predef
.*;
import
static
com
.
oracle
.
truffle
.
r
.
runtime
.
builtins
.
RBehavior
.
IO
;
import
static
com
.
oracle
.
truffle
.
r
.
runtime
.
builtins
.
RBuiltinKind
.
INTERNAL
;
...
...
@@ -34,6 +33,7 @@ import java.util.Map;
import
java.util.Set
;
import
com.oracle.truffle.api.CompilerDirectives.TruffleBoundary
;
import
com.oracle.truffle.api.dsl.Fallback
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.r.nodes.builtin.CastBuilder
;
import
com.oracle.truffle.r.nodes.builtin.RBuiltinNode
;
...
...
@@ -54,17 +54,17 @@ public abstract class ReadDCF extends RBuiltinNode {
@Override
protected
void
createCasts
(
CastBuilder
casts
)
{
casts
.
arg
(
"conn"
).
mustBe
(
RConnection
.
class
);
casts
.
arg
(
"fields"
).
mustBe
(
stringValue
()).
asStringVector
();
casts
.
arg
(
"keepwhite"
).
mustBe
(
stringValue
()).
asStringVector
();
}
@Specialization
@TruffleBoundary
protected
RStringVector
doReadDCF
(
RConnection
conn
,
RAbstractStringVector
fields
,
RAbstractStringVector
keepWhite
)
{
protected
RStringVector
doReadDCF
(
RConnection
conn
,
Object
fieldsObj
,
Object
keepWhiteObj
)
{
RAbstractStringVector
fields
=
fieldsObj
==
RNull
.
instance
?
null
:
(
RAbstractStringVector
)
RRuntime
.
asAbstractVector
(
fieldsObj
);
RAbstractStringVector
keepWhite
=
keepWhiteObj
==
RNull
.
instance
?
null
:
(
RAbstractStringVector
)
RRuntime
.
asAbstractVector
(
keepWhiteObj
);
DCF
dcf
=
null
;
try
(
RConnection
openConn
=
conn
.
forceOpen
(
"r"
))
{
Set
<
String
>
keepWhiteSet
=
null
;
if
(
keepWhite
.
getLength
()
>
0
)
{
if
(
keepWhite
!=
null
)
{
keepWhiteSet
=
new
HashSet
<>(
keepWhite
.
getLength
());
for
(
int
i
=
0
;
i
<
keepWhite
.
getLength
();
i
++)
{
keepWhiteSet
.
add
(
keepWhite
.
getDataAt
(
i
));
...
...
@@ -122,7 +122,7 @@ public abstract class ReadDCF extends RBuiltinNode {
}
private
static
boolean
needField
(
String
fieldName
,
RAbstractStringVector
fields
)
{
if
(
fields
.
getLength
()
>
0
)
{
if
(
fields
==
null
)
{
return
true
;
}
for
(
int
i
=
0
;
i
<
fields
.
getLength
();
i
++)
{
...
...
@@ -133,4 +133,9 @@ public abstract class ReadDCF extends RBuiltinNode {
return
false
;
}
@SuppressWarnings
(
"unused"
)
@Fallback
protected
RStringVector
doReadDCF
(
Object
conn
,
Object
fields
,
Object
keepWhite
)
{
throw
RError
.
error
(
this
,
RError
.
Message
.
INVALID_OR_UNIMPLEMENTED_ARGUMENTS
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment